[Serializer] Remove a now useless call to method_exists

This commit is contained in:
Kévin Dunglas 2017-05-18 08:57:19 +02:00
parent 15b7cdb9d9
commit 6425f8551a
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6

View File

@ -339,7 +339,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
$allowed = $allowedAttributes === false || in_array($paramName, $allowedAttributes); $allowed = $allowedAttributes === false || in_array($paramName, $allowedAttributes);
$ignored = !$this->isAllowedAttribute($class, $paramName, $format, $context); $ignored = !$this->isAllowedAttribute($class, $paramName, $format, $context);
if (method_exists($constructorParameter, 'isVariadic') && $constructorParameter->isVariadic()) { if ($constructorParameter->isVariadic()) {
if ($allowed && !$ignored && (isset($data[$key]) || array_key_exists($key, $data))) { if ($allowed && !$ignored && (isset($data[$key]) || array_key_exists($key, $data))) {
if (!is_array($data[$paramName])) { if (!is_array($data[$paramName])) {
throw new RuntimeException(sprintf('Cannot create an instance of %s from serialized data because the variadic parameter %s can only accept an array.', $class, $constructorParameter->name)); throw new RuntimeException(sprintf('Cannot create an instance of %s from serialized data because the variadic parameter %s can only accept an array.', $class, $constructorParameter->name));