Skip to content

Commit

Permalink
bug #13618 [PropertyAccess] Fixed invalid feedback -> foodback singul…
Browse files Browse the repository at this point in the history
…arization (WouterJ)

This PR was merged into the 2.3 branch.

Discussion
----------

[PropertyAccess] Fixed invalid feedback -> foodback singularization

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13613
| License       | MIT
| Doc PR        | -

Commits
-------

bc50125 Fixed invalid feedback -> foodback singularization
  • Loading branch information
fabpot committed Feb 16, 2015
2 parents def4fd5 + bc50125 commit ee47901
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 ee47901

Please sign in to comment.