Skip to content

Commit

Permalink
Fixed invalid feedback -> foodback singularization
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Feb 7, 2015
1 parent d9c0c55 commit bc50125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/PropertyAccess/StringUtil.php
Expand Up @@ -197,7 +197,7 @@ public static function singularify($plural)
}

// Convert teeth to tooth, feet to foot
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3) {
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3 && 'feedback' !== $plural) {
return substr_replace($plural, 'oo', $pos, 2);
}

Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php
Expand Up @@ -59,6 +59,7 @@ public function singularifyProvider()
array('data', array('daton', 'datum')),
array('days', 'day'),
array('discos', 'disco'),
array('devices', array('devex', 'devix', 'device')),
array('drives', 'drive'),
array('drivers', 'driver'),
array('dwarves', array('dwarf', 'dwarve', 'dwarff')),
Expand All @@ -67,6 +68,7 @@ public function singularifyProvider()
array('emphases', array('emphas', 'emphase', 'emphasis')),
array('faxes', 'fax'),
array('feet', 'foot'),
array('feedback', 'feedback'),
array('foci', 'focus'),
array('focuses', array('focus', 'focuse', 'focusis')),
array('formulae', 'formula'),
Expand Down

0 comments on commit bc50125

Please sign in to comment.