Skip to content

Commit

Permalink
bug #17745 Added more exceptions to singularify method (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Added more exceptions to singularify method

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

Added exceptions for `series`, `news` and `services`.

Commits
-------

f5daa0d Added more exceptions to singularify method
  • Loading branch information
fabpot committed Feb 12, 2016
2 parents 81d654f + f5daa0d commit 92d291a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Symfony/Component/PropertyAccess/StringUtil.php
Expand Up @@ -39,6 +39,9 @@ class StringUtil
// nebulae (nebula)
array('ea', 2, true, true, 'a'),

// services (service)
array('secivres', 8, true, true, 'service'),

// mice (mouse), lice (louse)
array('eci', 3, false, true, 'ouse'),

Expand Down Expand Up @@ -66,6 +69,12 @@ class StringUtil
// movies (movie)
array('seivom', 6, true, true, 'movie'),

// news (news)
array('swen', 4, true, true, 'news'),

// series (series)
array('seires', 6, true, true, 'series'),

// babies (baby)
array('sei', 3, false, true, 'y'),

Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php
Expand Up @@ -102,6 +102,7 @@ public function singularifyProvider()
array('movies', 'movie'),
array('nebulae', 'nebula'),
array('neuroses', array('neuros', 'neurose', 'neurosis')),
array('news', 'news'),
array('oases', array('oas', 'oase', 'oasis')),
array('objectives', 'objective'),
array('oxen', 'ox'),
Expand All @@ -120,6 +121,8 @@ public function singularifyProvider()
array('scarves', array('scarf', 'scarve', 'scarff')),
array('schemas', 'schema'), //schemata
array('selfies', 'selfie'),
array('series', 'series'),
array('services', 'service'),
array('sheriffs', 'sheriff'),
array('shoes', array('sho', 'shoe')),
array('spies', 'spy'),
Expand Down

0 comments on commit 92d291a

Please sign in to comment.