| Conditions | 1 |
| Paths | 1 |
| Total Lines | 69 |
| Code Lines | 65 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
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 |
||
| 55 | public function dataProvider() |
||
| 56 | { |
||
| 57 | return [ |
||
| 58 | // Russian alphabet |
||
| 59 | ['а', 'a'], |
||
| 60 | ['б', 'b'], |
||
| 61 | ['в', 'v'], |
||
| 62 | ['г', 'g'], |
||
| 63 | ['д', 'd'], |
||
| 64 | ['е', 'e'], |
||
| 65 | ['ё', 'e'], |
||
| 66 | ['ж', 'zh'], |
||
| 67 | ['з', 'z'], |
||
| 68 | ['и', 'i'], |
||
| 69 | ['й', 'y'], |
||
| 70 | ['к', 'k'], |
||
| 71 | ['л', 'l'], |
||
| 72 | ['м', 'm'], |
||
| 73 | ['н', 'n'], |
||
| 74 | ['о', 'o'], |
||
| 75 | ['п', 'p'], |
||
| 76 | ['р', 'r'], |
||
| 77 | ['с', 's'], |
||
| 78 | ['т', 't'], |
||
| 79 | ['у', 'u'], |
||
| 80 | ['ф', 'f'], |
||
| 81 | ['х', 'h'], |
||
| 82 | ['ц', 'ts'], |
||
| 83 | ['ч', 'ch'], |
||
| 84 | ['ш', 'sh'], |
||
| 85 | ['щ', 'sht'], |
||
| 86 | ['ь', ''], |
||
| 87 | ['ы', 'y'], |
||
| 88 | ['ъ', ''], |
||
| 89 | ['ю', 'yu'], |
||
| 90 | ['я', 'ya'], |
||
| 91 | ['А', 'A'], |
||
| 92 | ['Б', 'B'], |
||
| 93 | ['В', 'V'], |
||
| 94 | ['Г', 'G'], |
||
| 95 | ['Д', 'D'], |
||
| 96 | ['Е', 'E'], |
||
| 97 | ['Ж', 'Zh'], |
||
| 98 | ['З', 'Z'], |
||
| 99 | ['И', 'I'], |
||
| 100 | ['Й', 'Y'], |
||
| 101 | ['К', 'K'], |
||
| 102 | ['Л', 'L'], |
||
| 103 | ['М', 'M'], |
||
| 104 | ['Н', 'N'], |
||
| 105 | ['О', 'O'], |
||
| 106 | ['П', 'P'], |
||
| 107 | ['Р', 'R'], |
||
| 108 | ['С', 'S'], |
||
| 109 | ['Т', 'T'], |
||
| 110 | ['У', 'U'], |
||
| 111 | ['Ф', 'F'], |
||
| 112 | ['Х', 'H'], |
||
| 113 | ['Ц', 'Ts'], |
||
| 114 | ['Ч', 'Ch'], |
||
| 115 | ['Ш', 'Sh'], |
||
| 116 | ['Щ', 'Sht'], |
||
| 117 | ['Ь', ''], |
||
| 118 | ['Ы', 'Y'], |
||
| 119 | ['Ъ', ''], |
||
| 120 | ['Ю', 'Yu'], |
||
| 121 | ['Я', 'Ya'], |
||
| 122 | ]; |
||
| 123 | } |
||
| 124 | } |
||
| 125 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: