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

Commit4af9fa1

Browse files
committed
Fixing bug where PropertyInfoLoader tried to add validation to non-existent properties
1 parent4f714a6 commit4af9fa1

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

‎src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public function loadClassMetadata(ClassMetadata $metadata)
6060
continue;
6161
}
6262

63+
if (false ===property_exists($className,$property)) {
64+
continue;
65+
}
66+
6367
$types =$this->typeExtractor->getTypes($className,$property);
6468
if (null ===$types) {
6569
continue;

‎src/Symfony/Component/Validator/Tests/Fixtures/PropertyInfoLoaderEntity.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ class PropertyInfoLoaderEntity
4848
public$alreadyPartiallyMappedCollection;
4949

5050
public$readOnly;
51+
52+
publicfunctionsetNonExistentField()
53+
{
54+
}
5155
}

‎src/Symfony/Component/Validator/Tests/Mapping/Loader/PropertyInfoLoaderTest.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function testLoadClassMetadata()
4646
'alreadyMappedNotBlank',
4747
'alreadyPartiallyMappedCollection',
4848
'readOnly',
49+
'nonExistentField'
4950
])
5051
;
5152
$propertyInfoStub

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp