diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 224654df..e39b5d80 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -39,6 +39,7 @@ // Disabled because multiple lines allow code clarity. 'single_line_throw' => false, 'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true], + 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true] ]) ->setFinder($finder); diff --git a/src/Api/Monetization/Normalizer/EntityNormalizer.php b/src/Api/Monetization/Normalizer/EntityNormalizer.php index f3124a9b..d90bc7ed 100644 --- a/src/Api/Monetization/Normalizer/EntityNormalizer.php +++ b/src/Api/Monetization/Normalizer/EntityNormalizer.php @@ -20,6 +20,7 @@ use Apigee\Edge\Api\Monetization\Structure\NestedObjectReferenceInterface; use Apigee\Edge\Normalizer\ObjectNormalizer; +use ReflectionObject; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; @@ -60,6 +61,7 @@ public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory * {@inheritdoc} * * @psalm-suppress InvalidReturnType stdClass is also an object. + * @psalm-suppress InvalidPropertyFetch. */ public function normalize($object, $format = null, array $context = []) { @@ -123,7 +125,7 @@ public function normalize($object, $format = null, array $context = []) protected function getNestedObjectProperties($object): array { $entityReferenceProperties = []; - $ro = new \ReflectionObject($object); + $ro = new ReflectionObject($object); foreach ($ro->getProperties() as $property) { $property->setAccessible(true); $value = $property->getValue($object);