Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Jul 10, 2016
1 parent 98bcb91 commit 988eba1
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,13 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
}
} 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
Expand Down

0 comments on commit 988eba1

Please sign in to comment.