Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bc832e

Browse files
committed
fix(property-info): make sure that SerializerExtractor returns null for invalid class metadata
1 parentc4cc4d5 commit7bc832e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

‎src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function getProperties(string $class, array $context = []): ?array
3434
returnnull;
3535
}
3636

37-
if (!$this->classMetadataFactory->getMetadataFor($class)) {
37+
if (!$this->classMetadataFactory->hasMetadataFor($class)) {
3838
returnnull;
3939
}
4040

‎src/Symfony/Component/PropertyInfo/Tests/Extractor/SerializerExtractorTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,9 @@ public function testGetPropertiesWithAnyGroup()
5555
{
5656
$this->assertSame(['analyses','feet'],$this->extractor->getProperties(AdderRemoverDummy::class, ['serializer_groups' =>null]));
5757
}
58+
59+
publicfunctiontestGetPropertiesWithNonExistentClassReturnsNull()
60+
{
61+
$this->assertSame(null,$this->extractor->getProperties('NonExistent'));
62+
}
5863
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp