| Conditions | 1 |
| Paths | 1 |
| Total Lines | 75 |
| Code Lines | 40 |
| 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 |
||
| 9 | public function parametersProvider() |
||
| 10 | { |
||
| 11 | return [ |
||
| 12 | [ |
||
| 13 | 'desked', |
||
| 14 | [ |
||
| 15 | 'areaLimit' => 1 |
||
| 16 | ], |
||
| 17 | true |
||
| 18 | ], |
||
| 19 | [ |
||
| 20 | 'desked', |
||
| 21 | [ |
||
| 22 | 'invalid' => 'true' |
||
| 23 | ], |
||
| 24 | false |
||
| 25 | ], |
||
| 26 | [ |
||
| 27 | 'auto', |
||
| 28 | [ |
||
| 29 | 'offset' => 20, |
||
| 30 | 'limit' => 20 |
||
| 31 | ], |
||
| 32 | true |
||
| 33 | ], |
||
| 34 | [ |
||
| 35 | 'auto', |
||
| 36 | [ |
||
| 37 | 'offset' => 20, |
||
| 38 | 'limit' => 20, |
||
| 39 | 'invalid' => 'true' |
||
| 40 | ], |
||
| 41 | false |
||
| 42 | ], |
||
| 43 | [ |
||
| 44 | 'auto', |
||
| 45 | [ |
||
| 46 | 'offset' => 20, |
||
| 47 | 'limit' => 20, |
||
| 48 | 'includeSubsections' => 'true' |
||
| 49 | ], |
||
| 50 | true |
||
| 51 | ], |
||
| 52 | [ |
||
| 53 | 'auto', |
||
| 54 | [ |
||
| 55 | 'offset' => 20, |
||
| 56 | 'limit' => 20, |
||
| 57 | 'includeSubsections' => 'true', |
||
| 58 | 'homeSectionOnly' => 'true' |
||
| 59 | ], |
||
| 60 | true |
||
| 61 | ], |
||
| 62 | [ |
||
| 63 | 'auto', |
||
| 64 | [ |
||
| 65 | 'offset' => 20, |
||
| 66 | 'limit' => 20, |
||
| 67 | 'includeSubsections' => 'true', |
||
| 68 | 'invalid' => 'true' |
||
| 69 | ], |
||
| 70 | false |
||
| 71 | ], |
||
| 72 | [ |
||
| 73 | 'auto', |
||
| 74 | [ |
||
| 75 | 'offset' => 20, |
||
| 76 | 'limit' => 20, |
||
| 77 | 'invalid' => 'true', |
||
| 78 | 'homeSectionOnly' => 'true' |
||
| 79 | ], |
||
| 80 | false |
||
| 81 | ] |
||
| 82 | ]; |
||
| 83 | } |
||
| 84 | |||
| 94 |