| Conditions | 1 |
| Paths | 1 |
| Total Lines | 56 |
| 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 |
||
| 44 | public function getErrorList($testFile) |
||
| 45 | { |
||
| 46 | $ret = array( |
||
| 47 | // Extra space between interfaces, that a class implements. |
||
| 48 | 2 => 1, |
||
| 49 | // No space after comma, when extending several classes or implementing several interfaces. |
||
| 50 | // Class opening brace not on a new line. |
||
| 51 | 7 => 3, |
||
| 52 | // The "extends" keyword isn't on same line as the class name. |
||
| 53 | 12 => 1, |
||
| 54 | // The "implements" keyword isn't on same line as the class name. |
||
| 55 | 13 => 1, |
||
| 56 | // Extra new line before class closing brace. |
||
| 57 | 17 => 1, |
||
| 58 | // Extra space before extended class name or "implements" keyword. |
||
| 59 | 19 => 2, |
||
| 60 | // Incorrect 1st implemented interface name indentation (when on separate line). |
||
| 61 | 20 => 1, |
||
| 62 | // Incorrect 2nd implemented interface name indentation (when on separate line). |
||
| 63 | 21 => 1, |
||
| 64 | // Class opening brace not on a new line right after definition. |
||
| 65 | 22 => 1, |
||
| 66 | // Expected 1 space before "implements" keyword. |
||
| 67 | // The first item in a multi-line implements list must be on the line following the implements keyword. |
||
| 68 | 27 => 2, |
||
| 69 | // Incorrect 2nd implemented interface name indentation (when on separate line). |
||
| 70 | 34 => 1, |
||
| 71 | // Several interfaces implemented on a line in multi-line class declaration. |
||
| 72 | 35 => 2, |
||
| 73 | // Class declaration indented incorrectly. |
||
| 74 | 42 => 1, |
||
| 75 | // Incorrectly indented interface names multi-line class declaration. |
||
| 76 | 44 => 1, |
||
| 77 | // Incorrectly indented interface names multi-line class declaration. |
||
| 78 | 45 => 1, |
||
| 79 | // No empty line after closing class brace. Incorrect class declaration indentation. |
||
| 80 | 48 => 2, |
||
| 81 | // Comma placed not immediately after interface, when class implements several. |
||
| 82 | 63 => 1, |
||
| 83 | // Incorrect extended interface indentation in multi-line interface declaration. |
||
| 84 | 116 => 1, |
||
| 85 | // Incorrect extended interface indentation in multi-line interface declaration. |
||
| 86 | 118 => 1, |
||
| 87 | 119 => 1, |
||
| 88 | // Expected 1 space between abstract and class keywords; newline found. |
||
| 89 | 124 => 1, |
||
| 90 | 130 => 2, |
||
| 91 | 131 => 1, |
||
| 92 | // Too much empty lines after interface declaration. |
||
| 93 | 134 => 1, |
||
| 94 | // Class closing brace must on it's own line and must have an empty line after it. |
||
| 95 | 142 => 1, |
||
| 96 | ); |
||
| 97 | |||
| 98 | return $ret; |
||
| 99 | }//end getErrorList() |
||
| 100 | |||
| 117 |