merged branch bicpi/add_hasser_hint (PR #6110)

This PR was merged into the 2.1 branch.

Commits
-------

06ee53b [Form] improve error message with a "hasser" hint for PropertyAccessDeniedException

Discussion
----------

[Form] improve error msg w/ a "hasser" hint for PropertyAccessDeniedException

"Hasser" support was added under the 2.1 branch of the Form component

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:
Fabien Potencier 2012-11-25 11:54:09 +01:00
commit 96da146b9d

View File

@ -425,7 +425,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
$result[self::VALUE] = $objectOrArray->$property;
} elseif ($reflClass->hasProperty($property)) {
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;