8000 [Form] Fixed error message in PropertyPath to not advice to use a non… · sensi/symfony@bda29b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit bda29b3

Browse files
committed
[Form] Fixed error message in PropertyPath to not advice to use a non-existing feature
1 parent defccb3 commit bda29b3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Symfony/Component/Form/Tests/Util/PropertyPathCollectionTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ public function noAdderRemoverData()
299299
$expectedMessage = sprintf(
300300
'Neither element "axes" nor method "setAxes()" exists in class '
301301
.'"%s", nor could adders and removers be found based on the '
302-
.'guessed singulars: %s (provide a singular by suffixing the '
303-
.'property path with "|{singular}" to override the guesser)',
302+
.'guessed singulars: %s'
303+
// . '(provide a singular by suffixing the '
304+
// .'property path with "|{singular}" to override the guesser)'
305+
,
304306
get_class($car),
305307
implode(', ', (array) $singulars = FormUtil::singularify('Axes'))
306308
);
@@ -324,9 +326,10 @@ public function noAdderRemoverData()
324326
$propertyPath = new PropertyPath('axes');
325327
$expectedMessage = sprintf(
326328
'Property "axes" is not public in class "%s", nor could adders and '
327-
.'removers be found based on the guessed singulars: %s '
328-
.'(provide a singular by suffixing the property path with '
329-
.'"|{singular}" to override the guesser). Maybe you should '
329+
.'removers be found based on the guessed singulars: %s'
330+
// .' (provide a singular by suffixing the property path with '
331+
// .'"|{singular}" to override the guesser)'
332+
. '. Maybe you should '
330333
.'create the method "setAxes()"?',
331334
get_class($car),
332335
implode(', ', (array) $singulars = FormUtil::singularify('Axes'))

src/Symfony/Component/Form/Util/PropertyPath.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ private function writeProperty(&$objectOrArray, $property, $singular, $isIndex,
521521
} else {
522522
$adderRemoverError = ', nor could adders and removers be found based on the ';
523523
if (null === $singular) {
524-
$adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars).' (provide a singular by suffixing the property path with "|{singular}" to override the guesser)';
524+
// $adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars).' (provide a singular by suffixing the property path with "|{singular}" to override the guesser)';
525+
$adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars);
525526
} else {
526527
$adderRemoverError .= 'passed singular: '.$singular;
527528
}

0 commit comments

Comments
 (0)
0