Throw less misleading exception when property access not found

This commit is contained in:
Bram Tweedegolf 2016-06-22 14:09:31 +02:00 committed by Nicolas Grekas
parent 73099f3555
commit ec28da42ae

View File

@ -608,6 +608,8 @@ class PropertyAccessor implements PropertyAccessorInterface
// fatal error.
$object->$property = $value;
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s".', $property));
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
$object->{$access[self::ACCESS_NAME]}($value);
} else {