Skip to content

Commit 8edbc4c

Browse files
Merge branch '5.0' into 5.1
* 5.0: (28 commits) [Cache] $lifetime cannot be null [Serializer] minor cleanup fix merge Run PHP 8 as 7.4.99 Remove calls to deprecated ReflectionParameter::getClass(). [VarDumper] fix PHP 8 support Add php 8 to travis. [Cache] Accessing undefined constants raises an Error in php8 [Cache] allow DBAL v3 Skip Doctrine DBAL on php 8 until we have a compatible version. [DomCrawler] Catch expected ValueError. Made method signatures compatible with their corresponding traits. [ErrorHandler] Apply php8 fixes from Debug component. [DomCrawler] Catch expected ValueError. [Validator] Catch expected ValueError. [VarDumper] ReflectionFunction::isDisabled() is deprecated. [BrowserKit] Raw body with custom Content-Type header [PropertyAccess] Parse php 8 TypeErrors correctly. [Intl] Fix call to ReflectionProperty::getValue() for static properties. [HttpKernel] Prevent calling method_exists() with non-string values. ...
2 parents 003f8c1 + d324206 commit 8edbc4c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Normalizer/AbstractNormalizer.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,16 +411,10 @@ protected function instantiateObject(array &$data, string $class, array &$contex
411411
protected function denormalizeParameter(\ReflectionClass $class, \ReflectionParameter $parameter, string $parameterName, $parameterData, array $context, string $format = null)
412412
{
413413
try {
414-
if (\PHP_VERSION_ID < 70100 && null !== $parameterClass = $parameter->getClass()) {
415-
$parameterClass = $parameterClass->name;
416-
} elseif (\PHP_VERSION_ID >= 70100 && $parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
414+
if (($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
417415
$parameterClass = $parameterType->getName();
418416
new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist
419-
} else {
420-
$parameterClass = null;
421-
}
422417

423-
if (null !== $parameterClass) {
424418
if (!$this->serializer instanceof DenormalizerInterface) {
425419
throw new LogicException(sprintf('Cannot create an instance of "%s" from serialized data because the serializer inject in "%s" is not a denormalizer.', $parameterClass, static::class));
426420
}

0 commit comments

Comments
 (0)