8000 bug #10909 [PropertyAccess] Fixed plurals for -ves words (csarrazi) · symfony/symfony@912a72f · GitHub
[go: up one dir, main page]

Skip to content

Commit 912a72f

Browse files
committed
bug #10909 [PropertyAccess] Fixed plurals for -ves words (csarrazi)
This PR was merged into the 2.3 branch. Discussion ---------- [PropertyAccess] Fixed plurals for -ves words | Q | A | ---- 8000 --------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Fixes singularization for words like caves (cave), staves (staff). Commits ------- c7a77c5 Fixed incorrect regular plural for -ves words
2 parents 6207389 + c7a77c5 commit 912a72f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/Symfony/Component/PropertyAccess/StringUtil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class StringUtil
8181
// moves (move)
8282
array('sevom', 5, true, true, 'move'),
8383

84-
// hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf)
85-
array('sev', 3, true, true, 'f'),
84+
// hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff)
85+
array('sev', 3, true, true, array('f', 've', 'ff')),
8686

8787
// axes (axis), axes (ax), axes (axe)
8888
array('sexa', 4, false, false, array('ax', 'axe', 'axis')),

src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function singularifyProvider()
3838
array('feet', 'foot'),
3939
array('nebulae', 'nebula'),
4040
array('babies', 'baby'),
41-
array('hooves', 'hoof'),
41+
array('hooves', array('hoof', 'hoove', 'hooff')),
4242
array('chateaux', 'chateau'),
4343
array('echoes', array('echo', 'echoe')),
4444
array('analyses', array('analys', 'analyse', 'analysis')),
@@ -64,14 +64,14 @@ public function singularifyProvider()
6464
array('batches', array('batch', 'batche')),
6565
array('bushes', array('bush', 'bushe')),
6666
array('buses', array('bus', 'buse', 'busis')),
67-
array('calves', 'calf'),
67+
array('calves', array('calf', 'calve', 'calff')),
6868
array('circuses', array('circus', 'circuse', 'circusis')),
6969
array('crises', array('cris', 'crise', 'crisis')),
70-
array('dwarves', 'dwarf'),
71-
array('elves', 'elf'),
70+
array('dwarves', array('dwarf', 'dwarve', 'dwarff')),
71+
array('elves', array('elf', 'elve', 'elff')),
7272
array('emphases', array('emphas', 'emphase', 'emphasis')),
7373
array('faxes', 'fax'),
74-
array('halves', 'half'),
74+
array('halves', array('half', 'halve', 'halff')),
7575
array('heroes', array('hero', 'heroe')),
7676
array('hoaxes', 'hoax'),
7777
array('irises', array('iris', 'irise', 'irisis')),
@@ -86,13 +86,15 @@ public function singularifyProvider()
8686
array('plateaux', 'plateau'),
8787
array('poppies', 'poppy'),
8888
array('quizzes', 'quiz'),
89-
array('scarves', 'scarf'),
89+
array('scarves', array('scarf', 'scarve', 'scarff')),
9090
array('spies', 'spy'),
9191
array('stories', 'story'),
9292
array('syllabi', 'syllabus'),
93-
array('thieves', 'thief'),
93+
array('thieves', array('thief', 'thieve', 'thieff')),
9494
array('waltzes', array('waltz', 'waltze')),
95-
array('wharves', 'wharf'),
95+
array('wharves', array('wharf', 'wharve', 'wharff')),
96+
array('caves', array('caf', 'cave', 'caff')),
97+
array('staves', array('staf', 'stave', 'staff')),
9698
array('wives', 'wife'),
9799
array('ions', 'ion'),
98100
array('bases', array('bas', 'base', 'basis')),

0 commit comments

Comments
 (0)
0