Skip to content

[PropertyInfo] Make sure that SerializerExtractor returns null for invalid class metadata #59367

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

Merged
merged 1 commit into from
Jan 7, 2025
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
fix(property-info): make sure that SerializerExtractor returns null f…
…or invalid class metadata
  • Loading branch information
wuchen90 committed Jan 7, 2025
commit 7bc832e29c96e905858f59e0b10c21e452be5ba3
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getProperties(string $class, array $context = []): ?array
return null;
}

if (!$this->classMetadataFactory->getMetadataFor($class)) {
if (!$this->classMetadataFactory->hasMetadataFor($class)) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ public function testGetPropertiesWithAnyGroup()
{
$this->assertSame(['analyses', 'feet'], $this->extractor->getProperties(AdderRemoverDummy::class, ['serializer_groups' => null]));
}

public function testGetPropertiesWithNonExistentClassReturnsNull()
{
$this->assertSame(null, $this->extractor->getProperties('NonExistent'));
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy