8000 bug #49681 [String] Correct inflection of 'codes' and 'names' (Gwendo… · symfony/symfony@6ab60c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ab60c4

Browse files
bug #49681 [String] Correct inflection of 'codes' and 'names' (GwendolenLynch)
This PR was merged into the 5.4 branch. Discussion ---------- [String] Correct inflection of 'codes' and 'names' | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Singularizing of `codes` and `names` currently returns `cod` and `nam`. This PR simply adds them as suffixes, with tests. Commits ------- 97e932e [String] Correct inflection of 'codes' and 'names'
2 parents f4177aa + 97e932e commit 6ab60c4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Symfony/Component/String/Inflector/EnglishInflector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ final class EnglishInflector implements InflectorInterface
5555
// indices (index), appendices (appendix), prices (price)
5656
['seci', 4, false, true, ['ex', 'ix', 'ice']],
5757

58+
// codes (code)
59+
['sedoc', 5, false, true, 'code'],
60+
5861
// selfies (selfie)
5962
['seifles', 7, true, true, 'selfie'],
6063

@@ -64,6 +67,9 @@ final class EnglishInflector implements InflectorInterface
6467
// movies (movie)
6568
['seivom', 6, true, true, 'movie'],
6669

70+
// names (name)
71+
['seman', 5, true, false, 'name'],
72+
6773
// conspectuses (conspectus), prospectuses (prospectus)
6874
['sesutcep', 8, true, true, 'pectus'],
6975

src/Symfony/Component/String/Tests/Inflector/EnglishInflectorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static function singularizeProvider()
5454
['children', 'child'],
5555
['circuses', ['circus', 'circuse', 'circusis']],
5656
['cliffs', 'cliff'],
57+
['codes', 'code'],
5758
['committee', 'committee'],
5859
['crises', ['cris', 'crise', 'crisis']],
5960
['criteria', ['criterion', 'criterium']],
@@ -108,6 +109,7 @@ public static function singularizeProvider()
108109
['mice', 'mouse'],
109110
['moves', 'move'],
110111
['movies', 'movie'],
112+
['names', 'name'],
111113
['nebulae', 'nebula'],
112114
['neuroses', ['neuros', 'neurose', 'neurosis']],
113115
['news', 'news'],

0 commit comments

Comments
 (0)
0