File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,14 @@ public static function make(string $name): string
23
23
}
24
24
25
25
$ plural = $ name . 's ' ;
26
- $ plural = preg_replace ('/ys$/ ' , 'ies ' , $ plural );
27
- if ($ plural === null ) {
28
- throw new Exception ('Error while making plural ' );
29
- }
30
26
31
- $ plural = preg_replace ('/ss$/ ' , 'ses ' , $ plural );
27
+ $ replacements = [
28
+ '/ys$/ ' => 'ies ' ,
29
+ '/ss$/ ' => 'ses ' ,
30
+ '/xs$/ ' => 'xes ' ,
31
+ ];
32
+
33
+ $ plural = preg_replace (array_keys ($ replacements ), $ replacements , $ plural );
32
34
if ($ plural === null ) {
33
35
throw new Exception ('Error while making plural ' );
34
36
}
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ public function providerMake(): iterable
127
127
yield ['RiskClassification ' , 'RiskClassifications ' ];
128
128
yield ['RiskFrequency ' , 'RiskFrequencies ' ];
129
129
yield ['RiskLevel ' , 'RiskLevels ' ];
130
- yield ['RiskMatrix ' , 'RiskMatrixs ' ];
130
+ yield ['RiskMatrix ' , 'RiskMatrixes ' ];
131
131
yield ['RiskSeverity ' , 'RiskSeverities ' ];
132
132
yield ['Rite ' , 'Rites ' ];
133
133
yield ['RoleContextInterface ' , 'RoleContextInterfaces ' ];
You can’t perform that action at this time.
0 commit comments