Conditions | 1 |
Paths | 1 |
Total Lines | 71 |
Code Lines | 67 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | 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 |
||
39 | $this->assertEquals($transliteratedText, $this->transliterator->ruToEn($russianText)); |
||
40 | } |
||
41 | |||
42 | public function alphabetProvider(): array |
||
43 | { |
||
44 | return [ |
||
45 | ['а', 'a'], |
||
46 | ['б', 'b'], |
||
47 | ['в', 'v'], |
||
48 | ['г', 'g'], |
||
49 | ['д', 'd'], |
||
50 | ['е', 'e'], |
||
51 | ['ё', 'e'], |
||
52 | ['ж', 'zh'], |
||
53 | ['з', 'z'], |
||
54 | ['и', 'i'], |
||
55 | ['й', 'y'], |
||
56 | ['к', 'k'], |
||
57 | ['л', 'l'], |
||
58 | ['м', 'm'], |
||
59 | ['н', 'n'], |
||
60 | ['о', 'o'], |
||
61 | ['п', 'p'], |
||
62 | ['р', 'r'], |
||
63 | ['с', 's'], |
||
64 | ['т', 't'], |
||
65 | ['у', 'u'], |
||
66 | ['ф', 'f'], |
||
67 | ['х', 'h'], |
||
68 | ['ц', 'ts'], |
||
69 | ['ч', 'ch'], |
||
70 | ['ш', 'sh'], |
||
71 | ['щ', 'sht'], |
||
72 | ['ь', ''], |
||
73 | ['ы', 'y'], |
||
74 | ['ъ', ''], |
||
75 | ['э', 'e'], |
||
76 | ['ю', 'yu'], |
||
77 | ['я', 'ya'], |
||
78 | ['А', 'A'], |
||
79 | ['Б', 'B'], |
||
80 | ['В', 'V'], |
||
81 | ['Г', 'G'], |
||
82 | ['Д', 'D'], |
||
83 | ['Е', 'E'], |
||
84 | ['Ж', 'Zh'], |
||
85 | ['З', 'Z'], |
||
86 | ['И', 'I'], |
||
87 | ['Й', 'Y'], |
||
88 | ['К', 'K'], |
||
89 | ['Л', 'L'], |
||
90 | ['М', 'M'], |
||
91 | ['Н', 'N'], |
||
92 | ['О', 'O'], |
||
93 | ['П', 'P'], |
||
94 | ['Р', 'R'], |
||
95 | ['С', 'S'], |
||
96 | ['Т', 'T'], |
||
97 | ['У', 'U'], |
||
98 | ['Ф', 'F'], |
||
99 | ['Х', 'H'], |
||
100 | ['Ц', 'Ts'], |
||
101 | ['Ч', 'Ch'], |
||
102 | ['Ш', 'Sh'], |
||
103 | ['Щ', 'Sht'], |
||
104 | ['Ь', ''], |
||
105 | ['Ы', 'Y'], |
||
106 | ['Ъ', ''], |
||
107 | ['Э', 'E'], |
||
108 | ['Ю', 'Yu'], |
||
109 | ['Я', 'Ya'], |
||
110 | ]; |
||
113 |