Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4: (21 commits)
  [SecurityBundle] Add `provider` XML attribute to the authenticators it’s missing from
  [DoctrineBridge] Test reset with a true manager
  Sync php-cs-fixer config file with 7.2
  [HttpClient] Fix parsing SSE
  [Notifier] Fix thread key in GoogleChat bridge
  [HttpKernel][Security] Fix accessing session for stateless request
  [Serializer] Fix `ObjectNormalizer` with property path
  test handling of special "value" constraint option
  [PhpUnitBridge] Add missing import
  [FrameworkBundle] Fix setting default context for certain normalizers
  [57251] Missing translations for Romanian (ro)
  [ErrorHandler] Fix rendered exception code highlighting on PHP 8.3
  [String] Fix #54611 pluralization of -on ending words + singularization of -a ending foreign words
  [Validator] [UniqueValidator] Use correct variable as parameter in (custom) error message
  [Messenger] Comply with Amazon SQS requirements for message body
  fix cssColor HSLA test dataProvider
  properly handle invalid data for false/true types
  chore: upgrade class doc
  add space in error message
  [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.
  ...
  • Loading branch information
xabbuh committed Jun 21, 2024
2 parents 0475303 + d8ae47c commit 99ff820
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 24 deletions.
49 changes: 32 additions & 17 deletions Inflector/EnglishInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,32 @@ final class EnglishInflector implements InflectorInterface
// Fourth entry: Whether the suffix may succeed a consonant
// Fifth entry: singular suffix, normal

// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
['a', 1, true, true, ['on', 'um']],
// bacteria (bacterium)
['airetcab', 8, true, true, 'bacterium'],

// corpora (corpus)
['aroproc', 7, true, true, 'corpus'],

// criteria (criterion)
['airetirc', 8, true, true, 'criterion'],

// curricula (curriculum)
['alucirruc', 9, true, true, 'curriculum'],

// genera (genus)
['areneg', 6, true, true, 'genus'],

// media (medium)
['aidem', 5, true, true, 'medium'],

// memoranda (memorandum)
['adnaromem', 9, true, true, 'memorandum'],

// phenomena (phenomenon)
['anemonehp', 9, true, true, 'phenomenon'],

// strata (stratum)
['atarts', 6, true, true, 'stratum'],

// nebulae (nebula)
['ea', 2, true, true, 'a'],
Expand Down Expand Up @@ -141,7 +165,7 @@ final class EnglishInflector implements InflectorInterface
// shoes (shoe)
['se', 2, true, true, ['', 'e']],

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

// tags (tag)
Expand Down Expand Up @@ -241,7 +265,7 @@ final class EnglishInflector implements InflectorInterface
// albums (album)
['mubla', 5, true, true, 'albums'],

// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
// bacteria (bacterium), curricula (curriculum), media (medium), memoranda (memorandum), phenomena (phenomenon), strata (stratum)
['mu', 2, true, true, 'a'],

// men (man), women (woman)
Expand All @@ -250,20 +274,11 @@ final class EnglishInflector implements InflectorInterface
// people (person)
['nosrep', 6, true, true, ['persons', 'people']],

// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
['noi', 3, true, true, 'ions'],

// coupon (coupons)
['nop', 3, true, true, 'pons'],

// seasons (season), treasons (treason), poisons (poison), lessons (lesson)
['nos', 3, true, true, 'sons'],

// icons (icon)
['noc', 3, true, true, 'cons'],
// criteria (criterion)
['noiretirc', 9, true, true, 'criteria'],

// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
['no', 2, true, true, 'a'],
// phenomena (phenomenon)
['nonemonehp', 10, true, true, 'phenomena'],

// echoes (echo)
['ohce', 4, true, true, 'echoes'],
Expand Down
28 changes: 21 additions & 7 deletions Tests/Inflector/EnglishInflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function singularizeProvider()
['atlases', ['atlas', 'atlase', 'atlasis']],
['axes', ['ax', 'axe', 'axis']],
['babies', 'baby'],
['bacteria', ['bacterion', 'bacterium']],
['bacteria', 'bacterium'],
['bases', ['bas', 'base', 'basis']],
['batches', ['batch', 'batche']],
['beaux', 'beau'],
Expand All @@ -46,6 +46,7 @@ public static function singularizeProvider()
['bureaux', 'bureau'],
['buses', ['bus', 'buse', 'busis']],
['bushes', ['bush', 'bushe']],
['buttons', 'button'],
['calves', ['calf', 'calve', 'calff']],
['cars', 'car'],
['cassettes', ['cassett', 'cassette']],
Expand All @@ -57,10 +58,12 @@ public static function singularizeProvider()
['cliffs', 'cliff'],
['codes', 'code'],
['committee', 'committee'],
['corpora', 'corpus'],
['coupons', 'coupon'],
['crises', ['cris', 'crise', 'crisis']],
['criteria', ['criterion', 'criterium']],
['criteria', 'criterion'],
['cups', 'cup'],
['coupons', 'coupon'],
['curricula', 'curriculum'],
['data', 'data'],
['days', 'day'],
['discos', 'disco'],
Expand All @@ -86,6 +89,7 @@ public static function singularizeProvider()
['funguses', ['fungus', 'funguse', 'fungusis']],
['garages', ['garag', 'garage']],
['geese', 'goose'],
['genera', 'genus'],
['halves', ['half', 'halve', 'halff']],
['hats', 'hat'],
['heroes', ['hero', 'heroe']],
Expand All @@ -106,6 +110,8 @@ public static function singularizeProvider()
['lives', 'life'],
['matrices', ['matrex', 'matrix', 'matrice']],
['matrixes', 'matrix'],
['media', 'medium'],
['memoranda', 'memorandum'],
['men', 'man'],
['mice', 'mouse'],
['moves', 'move'],
Expand All @@ -120,7 +126,7 @@ public static function singularizeProvider()
['parties', 'party'],
['people', 'person'],
['persons', 'person'],
['phenomena', ['phenomenon', 'phenomenum']],
['phenomena', 'phenomenon'],
['photos', 'photo'],
['pianos', 'piano'],
['plateaux', 'plateau'],
Expand All @@ -146,7 +152,7 @@ public static function singularizeProvider()
['status', 'status'],
['statuses', 'status'],
['stories', 'story'],
['strata', ['straton', 'stratum']],
['strata', 'stratum'],
['suitcases', ['suitcas', 'suitcase', 'suitcasis']],
['syllabi', 'syllabus'],
['tags', 'tag'],
Expand Down Expand Up @@ -200,7 +206,9 @@ public static function pluralizeProvider()
['bureau', ['bureaus', 'bureaux']],
['bus', 'buses'],
['bush', 'bushes'],
['button', 'buttons'],
['calf', ['calfs', 'calves']],
['campus', 'campuses'],
['car', 'cars'],
['cassette', 'cassettes'],
['cave', 'caves'],
Expand All @@ -210,10 +218,11 @@ public static function pluralizeProvider()
['circus', 'circuses'],
['cliff', 'cliffs'],
['committee', 'committees'],
['coupon', 'coupons'],
['crisis', 'crises'],
['criteria', 'criterion'],
['criterion', 'criteria'],
['cup', 'cups'],
['coupon', 'coupons'],
['curriculum', 'curricula'],
['data', 'data'],
['day', 'days'],
['disco', 'discos'],
Expand All @@ -237,10 +246,12 @@ public static function pluralizeProvider()
['half', ['halfs', 'halves']],
['hat', 'hats'],
['hero', 'heroes'],
['hippocampus', 'hippocampi'],
['hippopotamus', 'hippopotami'], // hippopotamuses
['hoax', 'hoaxes'],
['hoof', ['hoofs', 'hooves']],
['house', 'houses'],
['icon', 'icons'],
['index', ['indicies', 'indexes']],
['ion', 'ions'],
['iris', 'irises'],
Expand All @@ -253,6 +264,8 @@ public static function pluralizeProvider()
['louse', 'lice'],
['man', 'men'],
['matrix', ['matricies', 'matrixes']],
['medium', 'media'],
['memorandum', 'memoranda'],
['mouse', 'mice'],
['move', 'moves'],
['movie', 'movies'],
Expand Down Expand Up @@ -286,6 +299,7 @@ public static function pluralizeProvider()
['shoe', 'shoes'],
['species', 'species'],
['status', ['status', 'statuses']],
['stratum', 'strata'],
['spy', 'spies'],
['staff', 'staves'],
['story', 'stories'],
Expand Down

0 comments on commit 99ff820

Please sign in to comment.