fix tests

This commit is contained in:
Théo FIDRY 2016-07-10 18:16:12 +01:00
parent 98bcb91d13
commit 988eba11b6
No known key found for this signature in database
GPG Key ID: 2B998DE558208B67

View File

@ -323,14 +323,13 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
}
} elseif ($allowed && !$ignored && (isset($data[$key]) || array_key_exists($key, $data))) {
$parameterData = $data[$key];
if (null !== $constructorParameter->getType()) {
try {
try {
if (null !== $constructorParameter->getClass()) {
$parameterClass = $constructorParameter->getClass()->getName();
} catch (\ReflectionException $e) {
throw new RuntimeException(sprintf('Could not determine the class of the parameter "%s".', $key), 0, $e);
$parameterData = $this->serializer->deserialize($parameterData, $parameterClass, $format, $context);
}
$parameterData = $this->serializer->deserialize($parameterData, $parameterClass, $format, $context);
} catch (\ReflectionException $e) {
throw new RuntimeException(sprintf('Could not determine the class of the parameter "%s".', $key), 0, $e);
}
// Don't run set for a parameter passed to the constructor