File tree 1 file changed +4
-4
lines changed
src/Symfony/Component/String/Inflector
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
325
325
$ lowerPluralRev = strtolower ($ pluralRev );
326
326
$ pluralLength = \strlen ($ lowerPluralRev );
327
327
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 ) {
330
330
return [$ plural ];
331
331
}
332
332
@@ -404,8 +404,8 @@ public function pluralize(string $singular): array
404
404
$ lowerSingularRev = strtolower ($ singularRev );
405
405
$ singularLength = \strlen ($ lowerSingularRev );
406
406
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 ) {
409
409
return [$ singular ];
410
410
}
411
411
You can’t perform that action at this time.
0 commit comments