8000 Merge branch '5.1' · symfony/serializer@cbb3138 · GitHub
[go: up one dir, main page]

Skip to content

Commit cbb3138

Browse files
Merge branch '5.1'
* 5.1: (33 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 Removed "services" prototype node from "custom_authenticator" 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 Revert symfony/symfony#34986 Make ExpressionLanguageSyntax validator usable with annota 10000 tion ...
2 parents 017c3ca + 8edbc4c commit cbb3138

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)
0