Skip to content

Commit 9fdb90b

Browse files
committed
bug symfony#18911 Fixed singular of committee (peterrehm)
This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes symfony#18911). Discussion ---------- Fixed singular of committee | Q | A | ------------- | --- | Branch? | 2.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#18872, symfony#18748 | License | MIT | Doc PR | - In addition to PR symfony#18909. Commits ------- 5661d52 Fixed singular of committee
2 parents a81b6ce + 5661d52 commit 9fdb90b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Symfony/Component/PropertyAccess/StringUtil.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class StringUtil
2424
* @var array
2525
*
2626
* @see http://english-zone.com/spelling/plurals.html
27-
* @see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English
2827
*/
2928
private static $pluralMap = array(
3029
// First entry: plural suffix, reversed
@@ -69,6 +68,15 @@ class StringUtil
6968
// movies (movie)
7069
array('seivom', 6, true, true, 'movie'),
7170

71+
// feet (foot)
72+
array('teef', 4, true, true, 'foot'),
73+
74+
// geese (goose)
75+
array('eseeg', 5, true, true, 'goose'),
76+
77+
// teeth (tooth)
78+
array('hteet', 5, true, true, 'tooth'),
79+
7280
// news (news)
7381
array('swen', 4, true, true, 'news'),
7482

@@ -214,11 +222,6 @@ public static function singularify($plural)
214222
}
215223
}
216224

217-
// Convert teeth to tooth, feet to foot
218-
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3 && 'feedback' !== $plural) {
219-
return substr_replace($plural, 'oo', $pos, 2);
220-
}
221-
222225
// Assume that plural and singular is identical
223226
return $plural;
224227
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function singularifyProvider()
5353
array('children', 'child'),
5454
array('circuses', array('circus', 'circuse', 'circusis')),
5555
array('cliffs', 'cliff'),
56+
array('committee', 'committee'),
5657
array('crises', array('cris', 'crise', 'crisis')),
5758
array('criteria', array('criterion', 'criterium')),
5859
array('cups', 'cup'),

0 commit comments

Comments
 (0)