8000 [Serializer] Argument objects by theofidry · Pull Request #19277 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Serializer] Argument objects #19277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 11, 2016
Prev Previous commit
fix tests
  • Loading branch information
theofidry committed Jul 10, 2016
commit 988eba11b6057192cf292dcdd550ea9cfea042d6
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