From b3f03f92716b5a629bd7b16b2d77740143527766 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 23 May 2020 14:09:32 +0200 Subject: [PATCH 1/2] Remove calls to deprecated ReflectionParameter::getClass(). --- Normalizer/AbstractNormalizer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Normalizer/AbstractNormalizer.php b/Normalizer/AbstractNormalizer.php index f3b24e420..b98d58273 100644 --- a/Normalizer/AbstractNormalizer.php +++ b/Normalizer/AbstractNormalizer.php @@ -522,9 +522,7 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref protected function denormalizeParameter(\ReflectionClass $class, \ReflectionParameter $parameter, $parameterName, $parameterData, array $context, $format = null) { try { - if (\PHP_VERSION_ID < 70100 && null !== $parameterClass = $parameter->getClass()) { - $parameterClass = $parameterClass->name; - } elseif (\PHP_VERSION_ID >= 70100 && $parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) { + if ($parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) { $parameterClass = $parameterType->getName(); new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist } else { From 4281b4ebf3791daa28c046279dc8bdafd3baed8f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 23 May 2020 14:46:57 +0200 Subject: [PATCH 2/2] [Serializer] minor cleanup --- Normalizer/AbstractNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Normalizer/AbstractNormalizer.php b/Normalizer/AbstractNormalizer.php index d89c4660b..71b1e38d3 100644 --- a/Normalizer/AbstractNormalizer.php +++ b/Normalizer/AbstractNormalizer.php @@ -388,7 +388,7 @@ protected function denormalizeParameter(\ReflectionClass $class, \ReflectionPara try { if (\PHP_VERSION_ID < 70100 && null !== $parameterClass = $parameter->getClass()) { $parameterClass = $parameterClass->name; - } elseif (\PHP_VERSION_ID >= 70100 && $parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) { + } elseif (\PHP_VERSION_ID >= 70100 && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) { $parameterClass = $parameterType->getName(); new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist } else {