Skip to content

Commit 062e801

Browse files
Merge branch '2.7' into 2.8
* 2.7: [HttpKernel] Fix lowest dep [Security] fix check for empty usernames [Form] updated exception message of ButtonBuilder::setRequestHandler() [travis] Fix deps=high jobs Fix typo 'assets.package' => 'assets.packages' in UPGRADE-2.7 [Serializer] Simplify AbstractNormalizer::prepareForDenormalization() [HttpFoundation] [PSR-7] Allow to use resources as content body and to return resources from string content [DependencyInjection] Remove unused code in XmlFileLoader [HttpFoundation] Behaviour change in PHP7 for substr bumped Symfony version to 2.3.32 updated VERSION for 2.3.31 update CONTRIBUTORS for 2.3.31 updated CHANGELOG for 2.3.31 Conflicts: src/Symfony/Bridge/Twig/composer.json src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Component/HttpKernel/composer.json
2 parents 351d19d + 15308f0 commit 062e801

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

Normalizer/AbstractNormalizer.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,7 @@ protected function getAllowedAttributes($classOrObject, array $context, $attribu
272272
*/
273273
protected function prepareForDenormalization($data)
274274
{
275-
if (is_array($data) || is_object($data) && $data instanceof \ArrayAccess) {
276-
$normalizedData = $data;
277-
} elseif (is_object($data)) {
278-
$normalizedData = array();
279-
280-
foreach ($data as $attribute => $value) {
281-
$normalizedData[$attribute] = $value;
282-
}
283-
} else {
284-
$normalizedData = array();
285-
}
286-
287-
return $normalizedData;
275+
return (array) $data;
288276
}
289277

290278
/**

0 commit comments

Comments
 (0)