Fixing bug where PropertyInfoLoader tried to add validation to non-existent properties

This commit is contained in:
Ryan Weaver 2019-06-07 11:25:07 -04:00
parent 4f714a63bb
commit b702598b0b
3 changed files with 9 additions and 0 deletions

View File

@ -60,6 +60,10 @@ final class PropertyInfoLoader implements LoaderInterface
continue;
}
if (!property_exists($className, $property)) {
continue;
}
$types = $this->typeExtractor->getTypes($className, $property);
if (null === $types) {
continue;

View File

@ -48,4 +48,8 @@ class PropertyInfoLoaderEntity
public $alreadyPartiallyMappedCollection;
public $readOnly;
public function setNonExistentField()
{
}
}

View File

@ -46,6 +46,7 @@ class PropertyInfoLoaderTest extends TestCase
'alreadyMappedNotBlank',
'alreadyPartiallyMappedCollection',
'readOnly',
'nonExistentField',
])
;
$propertyInfoStub