merged branch bschussek/issue5388 (PR #5778)
This PR was merged into the 2.1 branch.
Commits
-------
bda29b3
[Form] Fixed error message in PropertyPath to not advice to use a non-existing feature
Discussion
----------
[Form] Fixed error message in PropertyPath to not advice to use a non-existing feature
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5388
Todo: -
License of the code: MIT
Documentation PR: -
This commit is contained in:
commit
a01ede2f4d
@ -299,8 +299,10 @@ abstract class PropertyPathCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
$expectedMessage = sprintf(
|
||||
'Neither element "axes" nor method "setAxes()" exists in class '
|
||||
.'"%s", nor could adders and removers be found based on the '
|
||||
.'guessed singulars: %s (provide a singular by suffixing the '
|
||||
.'property path with "|{singular}" to override the guesser)',
|
||||
.'guessed singulars: %s'
|
||||
// . '(provide a singular by suffixing the '
|
||||
// .'property path with "|{singular}" to override the guesser)'
|
||||
,
|
||||
get_class($car),
|
||||
implode(', ', (array) $singulars = FormUtil::singularify('Axes'))
|
||||
);
|
||||
@ -325,8 +327,9 @@ abstract class PropertyPathCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
$expectedMessage = sprintf(
|
||||
'Property "axes" is not public in class "%s", nor could adders and '
|
||||
.'removers be found based on the guessed singulars: %s'
|
||||
.'(provide a singular by suffixing the property path with '
|
||||
.'"|{singular}" to override the guesser). Maybe you should '
|
||||
// .' (provide a singular by suffixing the property path with '
|
||||
// .'"|{singular}" to override the guesser)'
|
||||
. '. Maybe you should '
|
||||
.'create the method "setAxes()"?',
|
||||
get_class($car),
|
||||
implode(', ', (array) $singulars = FormUtil::singularify('Axes'))
|
||||
|
@ -521,7 +521,8 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
|
||||
} else {
|
||||
$adderRemoverError = ', nor could adders and removers be found based on the ';
|
||||
if (null === $singular) {
|
||||
$adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars).' (provide a singular by suffixing the property path with "|{singular}" to override the guesser)';
|
||||
// $adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars).' (provide a singular by suffixing the property path with "|{singular}" to override the guesser)';
|
||||
$adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars);
|
||||
} else {
|
||||
$adderRemoverError .= 'passed singular: '.$singular;
|
||||
}
|
||||
|
Reference in New Issue
Block a user