File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/Symfony/Component/String/Inflector Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -325,8 +325,8 @@ public function singularize(string $plural): array
325325 $ lowerPluralRev = strtolower ($ pluralRev );
326326 $ pluralLength = \strlen ($ lowerPluralRev );
327327
328- // Check if the word is one which is not inflected, return early if so
329- if (\in_array ($ lowerPluralRev , self ::$ uninflected , true )) {
328+ // Check if the word is one which is not inflected or is an empty string , return early if so
329+ if (\in_array ($ lowerPluralRev , self ::$ uninflected , true ) || 0 === $ pluralLength ) {
330330 return [$ plural ];
331331 }
332332
@@ -404,8 +404,8 @@ public function pluralize(string $singular): array
404404 $ lowerSingularRev = strtolower ($ singularRev );
405405 $ singularLength = \strlen ($ lowerSingularRev );
406406
407- // Check if the word is one which is not inflected, return early if so
408- if (\in_array ($ lowerSingularRev , self ::$ uninflected , true )) {
407+ // Check if the word is one which is not inflected or is an empty string , return early if so
408+ if (\in_array ($ lowerSingularRev , self ::$ uninflected , true ) || 0 === $ singularLength ) {
409409 return [$ singular ];
410410 }
411411
You can’t perform that action at this time.
0 commit comments