Skip to content

Commit

Permalink
Fix for InvalidPropertyFetch error on composer analyze (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
divya-intelli authored Dec 5, 2023
1 parent 263a871 commit 9368e48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion src/Api/Monetization/Normalizer/EntityNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = [])
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9368e48

Please sign in to comment.