Skip to content

[String] Fix plural of word ending by pus #53715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Symfony/Component/String/Inflector/EnglishInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ final class EnglishInflector implements InflectorInterface
// circuses (circus)
['suc', 3, true, true, 'cuses'],

// hippocampi (hippocampus)
['supmacoppih', 11, false, false, 'hippocampi'],

// campuses (campus)
['sup', 3, true, true, 'puses'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other words ending in pus besides campus and hippocampus ? If we don't have a generic rule, maybe we should actually return the 2 options for the pus ending.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some research its seems that only hippocampus is irregular
Words like opus or octopus are plurialized with puses

I'm a non-native english speaker if someone can confirm 👀


// status (status)
['sutats', 6, true, true, ['status', 'statuses']],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ public static function pluralizeProvider()
['waltz', 'waltzes'],
['wife', 'wives'],
['icon', 'icons'],
['hippocampus', 'hippocampi'],
['campus', 'campuses'],

// test casing: if the first letter was uppercase, it should remain so
['Man', 'Men'],
Expand Down