[Form] improve error message with a "hasser" hint for PropertyAccessDeniedException
Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: no, but fails exactly the same as without this fix Fixes the following tickets: - Todo: - License of the code: MIT Documentation PR: symfony/symfony-docs#1958
This commit is contained in:
parent
1c0ba78833
commit
06ee53b73e
@ -425,7 +425,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
|||||||
$result[self::VALUE] = $objectOrArray->$property;
|
$result[self::VALUE] = $objectOrArray->$property;
|
||||||
} elseif ($reflClass->hasProperty($property)) {
|
} elseif ($reflClass->hasProperty($property)) {
|
||||||
if (!$reflClass->getProperty($property)->isPublic()) {
|
if (!$reflClass->getProperty($property)->isPublic()) {
|
||||||
throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()"?', $property, $reflClass->name, $getter, $isser));
|
throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()" or "%s()"?', $property, $reflClass->name, $getter, $isser, $hasser));
|
||||||
}
|
}
|
||||||
|
|
||||||
$result[self::VALUE] =& $objectOrArray->$property;
|
$result[self::VALUE] =& $objectOrArray->$property;
|
||||||
|
Reference in New Issue
Block a user