| Conditions | 1 |
| Paths | 1 |
| Total Lines | 100 |
| Code Lines | 41 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 5 | ||
| Bugs | 0 | 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 |
||
| 173 | public function invalidConfigurationProvider() { |
||
| 174 | return [ |
||
| 175 | [ |
||
| 176 | [] |
||
| 177 | ], |
||
| 178 | [ |
||
| 179 | [ |
||
| 180 | 'backend' => 'foo' |
||
| 181 | ] |
||
| 182 | ], |
||
| 183 | [ |
||
| 184 | [ |
||
| 185 | 'backend' => 'api', |
||
| 186 | 'api' => [] |
||
| 187 | ] |
||
| 188 | ], |
||
| 189 | [ |
||
| 190 | [ |
||
| 191 | 'backend' => 'api', |
||
| 192 | 'api' => [ |
||
| 193 | 'url' => '' |
||
| 194 | ] |
||
| 195 | ] |
||
| 196 | ], |
||
| 197 | [ |
||
| 198 | [ |
||
| 199 | 'backend' => 'api', |
||
| 200 | 'api' => [ |
||
| 201 | 'url' => 'http://www.wikidata.org/w/api.php', |
||
| 202 | 'wikidataquery-url' => '' |
||
| 203 | ] |
||
| 204 | ] |
||
| 205 | ], |
||
| 206 | [ |
||
| 207 | [ |
||
| 208 | 'backend' => 'mongodb', |
||
| 209 | 'mongodb' => [] |
||
| 210 | ] |
||
| 211 | ], |
||
| 212 | [ |
||
| 213 | [ |
||
| 214 | 'backend' => 'api', |
||
| 215 | 'api' => [ |
||
| 216 | 'url' => 'http://www.wikidata.org/w/api.php' |
||
| 217 | ], |
||
| 218 | 'cache' => [ |
||
| 219 | 'memcached' => 'toto' |
||
| 220 | ] |
||
| 221 | ] |
||
| 222 | ], |
||
| 223 | [ |
||
| 224 | [ |
||
| 225 | 'backend' => 'api', |
||
| 226 | 'api' => [ |
||
| 227 | 'url' => 'http://www.wikidata.org/w/api.php' |
||
| 228 | ], |
||
| 229 | 'cache' => [ |
||
| 230 | 'lifetime' => 'tata' |
||
| 231 | ] |
||
| 232 | ] |
||
| 233 | ], |
||
| 234 | [ |
||
| 235 | [ |
||
| 236 | 'backend' => 'api', |
||
| 237 | 'api' => [ |
||
| 238 | 'url' => 'http://www.wikidata.org/w/api.php' |
||
| 239 | ], |
||
| 240 | 'cache' => [ |
||
| 241 | 'array' => 'tata' |
||
| 242 | ] |
||
| 243 | ] |
||
| 244 | ], |
||
| 245 | [ |
||
| 246 | [ |
||
| 247 | 'backend' => 'api', |
||
| 248 | 'api' => [ |
||
| 249 | 'url' => 'http://www.wikidata.org/w/api.php' |
||
| 250 | ], |
||
| 251 | 'cache' => [ |
||
| 252 | 'memcached' => [ |
||
| 253 | 'host' => [] |
||
| 254 | ] |
||
| 255 | ] |
||
| 256 | ] |
||
| 257 | ], |
||
| 258 | [ |
||
| 259 | [ |
||
| 260 | 'backend' => 'api', |
||
| 261 | 'api' => [ |
||
| 262 | 'url' => 'http://www.wikidata.org/w/api.php' |
||
| 263 | ], |
||
| 264 | 'cache' => [ |
||
| 265 | 'memcached' => [ |
||
| 266 | 'port' => 'foo' |
||
| 267 | ] |
||
| 268 | ] |
||
| 269 | ] |
||
| 270 | ], |
||
| 271 | ]; |
||
| 272 | } |
||
| 273 | } |
||
| 274 |