Skip to content

Commit

Permalink
protect from invalid array access in RecursiveFormatterHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Nil Portugues Caldero committed Jun 22, 2016
1 parent e76fc22 commit 91f8146
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Transformer/Helpers/RecursiveFormatterHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ public static function getIdPropertyAndValues(array &$mappings, array &$value, $
$idProperties = self::getIdProperties($mappings, $type);

foreach ($idProperties as &$propertyName) {
$values[] = self::getIdValue($value[$propertyName]);
$propertyName = \sprintf('{%s}', $propertyName);
if (array_key_exists($propertyName, $value)) {
$values[] = self::getIdValue($value[$propertyName]);
$propertyName = \sprintf('{%s}', $propertyName);
}
}
self::flattenObjectsWithSingleKeyScalars($values);

Expand Down

0 comments on commit 91f8146

Please sign in to comment.