Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50d9ce1

Browse files
committed
cs
1 parent 09f7c0d commit 50d9ce1

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,7 @@ protected function instantiateObject(array &$data, string $class, array &$contex
446446
unset($context['has_constructor']);
447447

448448
if (!$reflectionClass->isInstantiable()) {
449-
throw NotNormalizableValueException::createForUnexpectedDataType(
450-
sprintf('Failed to create object because the class "%s" is not instantiable.', $class),
451-
$data,
452-
['unknown'],
453-
$context['deserialization_path'] ?? null
454-
);
449+
throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('Failed to create object because the class "%s" is not instantiable.', $class), $data, ['unknown'], $context['deserialization_path'] ?? null);
455450
}
456451

457452
return new $class();
@@ -542,7 +537,7 @@ final protected function applyFilterBool(\ReflectionParameter $parameter, mixed
542537
return $value;
543538
}
544539

545-
if (!($parameterType = $parameter->getType()) instanceof \ReflectionType || 'bool' !== $parameterType->getName()) {
540+
if (!($parameterType = $parameter->getType()) instanceof \ReflectionNamedType || 'bool' !== $parameterType->getName()) {
546541
return $value;
547542
}
548543

src/Symfony/Component/Serializer/Tests/Normalizer/Features/FilterBoolObject.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
class FilterBoolObject
1515
{
16-
public function __construct(public ?bool $value) {
16+
public function __construct(public ?bool $value)
17+
{
1718
}
1819
}

src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
3333
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
3434
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
35-
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
3635
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
3736
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
3837
use Symfony\Component\Serializer\Serializer;

0 commit comments

Comments
 (0)