Conditions | 1 |
Paths | 1 |
Total Lines | 56 |
Code Lines | 54 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
25 | protected function ruleIrregular(): array |
||
26 | { |
||
27 | return [ |
||
28 | 'move' => 'moves', |
||
29 | 'sex' => 'sexes', |
||
30 | 'child' => 'children', |
||
31 | 'man' => 'men', |
||
32 | 'person' => 'people', |
||
33 | 'I' => 'we', |
||
34 | 'me' => 'us', |
||
35 | 'he' => 'they', |
||
36 | 'she' => 'they', |
||
37 | 'them' => 'them', |
||
38 | 'myself' => 'ourselves', |
||
39 | 'yourself' => 'yourselves', |
||
40 | 'itself' => 'themselves', |
||
41 | 'herself' => 'themselves', |
||
42 | 'himself' => 'themselves', |
||
43 | 'themself' => 'themselves', |
||
44 | 'is' => 'are', |
||
45 | 'was' => 'were', |
||
46 | 'has' => 'have', |
||
47 | 'this' => 'these', |
||
48 | 'that' => 'those', |
||
49 | 'echo' => 'echoes', |
||
50 | 'dingo' => 'dingoes', |
||
51 | 'volcano' => 'volcanoes', |
||
52 | 'tornado' => 'tornadoes', |
||
53 | 'torpedo' => 'torpedoes', |
||
54 | 'genus' => 'genera', |
||
55 | 'viscus' => 'viscera', |
||
56 | 'stigma' => 'stigmata', |
||
57 | 'stoma' => 'stomata', |
||
58 | 'dogma' => 'dogmata', |
||
59 | 'lemma' => 'lemmata', |
||
60 | 'schema' => 'schemata', |
||
61 | 'anathema' => 'anathemata', |
||
62 | 'ox' => 'oxen', |
||
63 | 'axe' => 'axes', |
||
64 | 'die' => 'dice', |
||
65 | 'yes' => 'yeses', |
||
66 | 'foot' => 'feet', |
||
67 | 'eave' => 'eaves', |
||
68 | 'goose' => 'geese', |
||
69 | 'tooth' => 'teeth', |
||
70 | 'quiz' => 'quizzes', |
||
71 | 'human' => 'humans', |
||
72 | 'proof' => 'proofs', |
||
73 | 'carve' => 'carves', |
||
74 | 'valve' => 'valves', |
||
75 | 'looey' => 'looies', |
||
76 | 'thief' => 'thieves', |
||
77 | 'groove' => 'grooves', |
||
78 | 'pickaxe' => 'pickaxes', |
||
79 | 'passerby' => 'passersby', |
||
80 | 'cookie' => 'cookies' |
||
81 | ]; |
||
261 | } |