Skip to content

Commit a3b57cc

Browse files
Merge branch '6.4' into 7.0
* 6.4: [FrameworkBundle] Add TemplateController to the list of allowed controllers for fragments [Cache][Lock] Fix PDO store not creating table + add tests Closes #51936-Added Missing translations for Czech (cs) in validators.cs.xlf file Added missing translations in turkish and updated validators.tr.xlf [Serializer] Fix denormalizing date intervals having both weeks and days [Validator] updated Turkish translation [Serializer] Remove wrong final tags [Serializer] Fix denormalize constructor arguments Add some more non-countable English nouns Add hint that changing input arguments has no effect register the virtual request stack together with common profiling services Don't lose checkpoint state when lock is acquired from another [DomCrawler] Revert "bug #52579 UriResolver support path with colons" [VarExporter] Fix handling mangled property names returned by __sleep() Update Github template for 7.1 Fix memory limit in PhpSubprocess unit test
2 parents c26cedd + 6c4c7ed commit a3b57cc

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

Inflector/EnglishInflector.php

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class EnglishInflector implements InflectorInterface
2121
private const PLURAL_MAP = [
2222
// First entry: plural suffix, reversed
2323
// Second entry: length of plural suffix
24-
// Third entry: Whether the suffix may succeed a vocal
24+
// Third entry: Whether the suffix may succeed a vowel
2525
// Fourth entry: Whether the suffix may succeed a consonant
2626
// Fifth entry: singular suffix, normal
2727

@@ -162,7 +162,7 @@ final class EnglishInflector implements InflectorInterface
162162
private const SINGULAR_MAP = [
163163
// First entry: singular suffix, reversed
164164
// Second entry: length of singular suffix
165-
// Third entry: Whether the suffix may succeed a vocal
165+
// Third entry: Whether the suffix may succeed a vowel
166166
// Fourth entry: Whether the suffix may succeed a consonant
167167
// Fifth entry: plural suffix, normal
168168

@@ -343,15 +343,30 @@ final class EnglishInflector implements InflectorInterface
343343
// deer
344344
'reed',
345345

346+
// equipment
347+
'tnempiuqe',
348+
346349
// feedback
347350
'kcabdeef',
348351

349352
// fish
350353
'hsif',
351354

355+
// health
356+
'htlaeh',
357+
358+
// history
359+
'yrotsih',
360+
352361
// info
353362
'ofni',
354363

364+
// information
365+
'noitamrofni',
366+
367+
// money
368+
'yenom',
369+
355370
// moose
356371
'esoom',
357372

@@ -363,6 +378,9 @@ final class EnglishInflector implements InflectorInterface
363378

364379
// species
365380
'seiceps',
381+
382+
// traffic
383+
'ciffart',
366384
];
367385

368386
public function singularize(string $plural): array
@@ -396,14 +414,14 @@ public function singularize(string $plural): array
396414
if ($j === $suffixLength) {
397415
// Is there any character preceding the suffix in the plural string?
398416
if ($j < $pluralLength) {
399-
$nextIsVocal = str_contains('aeiou', $lowerPluralRev[$j]);
417+
$nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]);
400418

401-
if (!$map[2] && $nextIsVocal) {
402-
// suffix may not succeed a vocal but next char is one
419+
if (!$map[2] && $nextIsVowel) {
420+
// suffix may not succeed a vowel but next char is one
403421
break;
404422
}
405423

406-
if (!$map[3] && !$nextIsVocal) {
424+
if (!$map[3] && !$nextIsVowel) {
407425
// suffix may not succeed a consonant but next char is one
408426
break;
409427
}
@@ -473,14 +491,14 @@ public function pluralize(string $singular): array
473491
if ($j === $suffixLength) {
474492
// Is there any character preceding the suffix in the plural string?
475493
if ($j < $singularLength) {
476-
$nextIsVocal = str_contains('aeiou', $lowerSingularRev[$j]);
494+
$nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]);
477495

478-
if (!$map[2] && $nextIsVocal) {
479-
// suffix may not succeed a vocal but next char is one
496+
if (!$map[2] && $nextIsVowel) {
497+
// suffix may not succeed a vowel but next char is one
480498
break;
481499
}
482500

483-
if (!$map[3] && !$nextIsVocal) {
501+
if (!$map[3] && !$nextIsVowel) {
484502
// suffix may not succeed a consonant but next char is one
485503
break;
486504
}

0 commit comments

Comments
 (0)