Closed
Description
Symfony version(s) affected: 5.1 and lower
Description
When generating entities (e.g. via nelmio/alice) it was long possible to write values into existing properties.
But now it seems like the property accessor does only allows this for instances of stdClass .
Possibly since this change: symfony/property-access@0583535
So when a class like
class Foo {
}
has no property but an object gets a property later on like
$o = new Foo();
$o->bla = null;
then the PropertyAcessor is no longer able to write into this existing property
and instead throws the NoSuchPropertyException exception with a "Could not determine access type" message.
Possible Solution
Drop the explicit check for stdClass
} elseif (property_exists($object, $property)) {
$object->$property = $value;
}