Skip to content

Commit

Permalink
is_scalar check before using $parentType as array key
Browse files Browse the repository at this point in the history
  • Loading branch information
nilportugues committed Aug 28, 2015
1 parent fd5cc5c commit 562ae06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Helpers/DataLinksHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function setResponseDataRelationshipSelfLinks($propertyName, array
$data = [];
$parentType = $parent[Serializer::CLASS_IDENTIFIER_KEY];

if (!empty($mappings[$parentType])) {
if (is_scalar($parentType) && !empty($mappings[$parentType])) {
list($idValues, $idProperties) = RecursiveFormatterHelper::getIdPropertyAndValues($mappings, $parent, $parentType);

$selfLink = $mappings[$parentType]->getRelationshipSelfUrl($propertyName);
Expand Down

0 comments on commit 562ae06

Please sign in to comment.