| Conditions | 1 |
| Paths | 1 |
| Total Lines | 96 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 81 | public function providerForTestResolve() |
||
| 82 | { |
||
| 83 | return array( |
||
| 84 | array( |
||
| 85 | '<text1>', |
||
| 86 | array( |
||
| 87 | 'eng-GB' => 'one', |
||
| 88 | 'cro-HR' => 'jedan', |
||
| 89 | ), |
||
| 90 | ), |
||
| 91 | array( |
||
| 92 | '<text1> <text2>', |
||
| 93 | array( |
||
| 94 | 'eng-GB' => 'one two', |
||
| 95 | 'cro-HR' => 'jedan dva', |
||
| 96 | ), |
||
| 97 | ), |
||
| 98 | array( |
||
| 99 | 'Hello <text1>', |
||
| 100 | array( |
||
| 101 | 'eng-GB' => 'Hello one', |
||
| 102 | 'cro-HR' => 'Hello jedan', |
||
| 103 | ), |
||
| 104 | ), |
||
| 105 | array( |
||
| 106 | 'Hello, <text1> and <text2> and then goodbye', |
||
| 107 | array( |
||
| 108 | 'eng-GB' => 'Hello, one and two and then goodbye', |
||
| 109 | 'cro-HR' => 'Hello, jedan and dva and then goodbye', |
||
| 110 | ), |
||
| 111 | ), |
||
| 112 | array( |
||
| 113 | '<text1|text2>', |
||
| 114 | array( |
||
| 115 | 'eng-GB' => 'one', |
||
| 116 | 'cro-HR' => 'jedan', |
||
| 117 | ), |
||
| 118 | ), |
||
| 119 | array( |
||
| 120 | '<text2|text1>', |
||
| 121 | array( |
||
| 122 | 'eng-GB' => 'two', |
||
| 123 | 'cro-HR' => 'dva', |
||
| 124 | ), |
||
| 125 | ), |
||
| 126 | array( |
||
| 127 | '<text3|text1>', |
||
| 128 | array( |
||
| 129 | 'eng-GB' => 'one', |
||
| 130 | 'cro-HR' => 'jedan', |
||
| 131 | ), |
||
| 132 | ), |
||
| 133 | array( |
||
| 134 | '<(<text1> <text2>)>', |
||
| 135 | array( |
||
| 136 | 'eng-GB' => 'one two', |
||
| 137 | 'cro-HR' => 'jedan dva', |
||
| 138 | ), |
||
| 139 | ), |
||
| 140 | array( |
||
| 141 | '<(<text3|text2>)>', |
||
| 142 | array( |
||
| 143 | 'eng-GB' => 'two', |
||
| 144 | 'cro-HR' => 'dva', |
||
| 145 | ), |
||
| 146 | ), |
||
| 147 | array( |
||
| 148 | '<text3|(<text3|text2>)>', |
||
| 149 | array( |
||
| 150 | 'eng-GB' => 'two', |
||
| 151 | 'cro-HR' => 'dva', |
||
| 152 | ), |
||
| 153 | ), |
||
| 154 | array( |
||
| 155 | '<text3|(Hello <text2> and <text1>!)>', |
||
| 156 | array( |
||
| 157 | 'eng-GB' => 'Hello two and one!', |
||
| 158 | 'cro-HR' => 'Hello dva and jedan!', |
||
| 159 | ), |
||
| 160 | ), |
||
| 161 | array( |
||
| 162 | '<text3|(Hello <text3> and <text1>)|text2>!', |
||
| 163 | array( |
||
| 164 | 'eng-GB' => 'Hello and one!', |
||
| 165 | 'cro-HR' => 'Hello and jedan!', |
||
| 166 | ), |
||
| 167 | ), |
||
| 168 | array( |
||
| 169 | '<text3|(Hello <text3|text2> and <text1>)|text2>!', |
||
| 170 | array( |
||
| 171 | 'eng-GB' => 'Hello two and one!', |
||
| 172 | 'cro-HR' => 'Hello dva and jedan!', |
||
| 173 | ), |
||
| 174 | ), |
||
| 175 | ); |
||
| 176 | } |
||
| 177 | |||
| 302 |