Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for InvalidPropertyFetch error on composer analyze #332

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading