Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 68ee96d

Browse filesBrowse files
committed
bug #41105 [Inflector][String] Fixed singularize edges > edge (ruudk)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Inflector][String] Fixed singularize `edges` > `edge` | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT I noticed that calling `$inflector->singularize('edges');` returned `['edg', 'edges']`. It should be `edge`, only. See https://en.wiktionary.org/wiki/edge Commits ------- ebfb0c9 [Inflector][String] Fixed singularize `edges` > `edge`
2 parents 4d3768f + ebfb0c9 commit 68ee96d
Copy full SHA for 68ee96d

File tree

2 files changed

+23
-0
lines changed
Filter options

2 files changed

+23
-0
lines changed

‎src/Symfony/Component/Inflector/Inflector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Inflector/Inflector.php
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ final class Inflector
123123
// fees (fee), trees (tree), employees (employee)
124124
['see', 3, true, true, 'ee'],
125125

126+
// edges (edge)
127+
['segd', 4, true, true, 'dge'],
128+
126129
// roses (rose), garages (garage), cassettes (cassette),
127130
// waltzes (waltz), heroes (hero), bushes (bush), arches (arch),
128131
// shoes (shoe)
@@ -314,14 +317,32 @@ final class Inflector
314317
*/
315318
private const UNINFLECTED = [
316319
'',
320+
321+
// data
317322
'atad',
323+
324+
// deer
318325
'reed',
326+
327+
// feedback
319328
'kcabdeef',
329+
330+
// fish
320331
'hsif',
332+
333+
// info
321334
'ofni',
335+
336+
// moose
322337
'esoom',
338+
339+
// series
323340
'seires',
341+
342+
// sheep
324343
'peehs',
344+
345+
// species
325346
'seiceps',
326347
];
327348

‎src/Symfony/Component/Inflector/Tests/InflectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Inflector/Tests/InflectorTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function singularizeProvider()
6666
['drivers', 'driver'],
6767
['dwarves', ['dwarf', 'dwarve', 'dwarff']],
6868
['echoes', ['echo', 'echoe']],
69+
['edges', 'edge'],
6970
['elves', ['elf', 'elve', 'elff']],
7071
['emphases', ['emphas', 'emphase', 'emphasis']],
7172
['employees', 'employee'],
@@ -210,6 +211,7 @@ public function pluralizeProvider()
210211
['driver', 'drivers'],
211212
['dwarf', ['dwarfs', 'dwarves']],
212213
['echo', 'echoes'],
214+
['edge', 'edges'],
213215
['elf', ['elfs', 'elves']],
214216
['emphasis', 'emphases'],
215217
['fax', ['facies', 'faxes']],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.