@@ -15,42 +15,42 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 12 => 1, |
|
| 30 | - 17 => 1, |
|
| 31 | - 22 => 1, |
|
| 32 | - 92 => 1, |
|
| 33 | - 93 => 1, |
|
| 34 | - 94 => 1, |
|
| 35 | - 99 => 1, |
|
| 36 | - ]; |
|
| 37 | - |
|
| 38 | - }//end getErrorList() |
|
| 39 | - |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Returns the lines where warnings should occur. |
|
| 43 | - * |
|
| 44 | - * The key of the array should represent the line number and the value |
|
| 45 | - * should represent the number of warnings that should occur on that line. |
|
| 46 | - * |
|
| 47 | - * @return array<int, int> |
|
| 48 | - */ |
|
| 49 | - public function getWarningList() |
|
| 50 | - { |
|
| 51 | - return []; |
|
| 52 | - |
|
| 53 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 12 => 1, |
|
| 30 | + 17 => 1, |
|
| 31 | + 22 => 1, |
|
| 32 | + 92 => 1, |
|
| 33 | + 93 => 1, |
|
| 34 | + 94 => 1, |
|
| 35 | + 99 => 1, |
|
| 36 | + ]; |
|
| 37 | + |
|
| 38 | + }//end getErrorList() |
|
| 39 | + |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Returns the lines where warnings should occur. |
|
| 43 | + * |
|
| 44 | + * The key of the array should represent the line number and the value |
|
| 45 | + * should represent the number of warnings that should occur on that line. |
|
| 46 | + * |
|
| 47 | + * @return array<int, int> |
|
| 48 | + */ |
|
| 49 | + public function getWarningList() |
|
| 50 | + { |
|
| 51 | + return []; |
|
| 52 | + |
|
| 53 | + }//end getWarningList() |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | }//end class |
@@ -15,52 +15,52 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 7 => 1, |
|
| 30 | - 10 => 1, |
|
| 31 | - 17 => 1, |
|
| 32 | - 20 => 1, |
|
| 33 | - 24 => 1, |
|
| 34 | - 25 => 1, |
|
| 35 | - 27 => 1, |
|
| 36 | - 28 => 1, |
|
| 37 | - 29 => 1, |
|
| 38 | - 30 => 1, |
|
| 39 | - 58 => 1, |
|
| 40 | - 123 => 1, |
|
| 41 | - 224 => 1, |
|
| 42 | - 225 => 1, |
|
| 43 | - 279 => 1, |
|
| 44 | - 284 => 1, |
|
| 45 | - 311 => 1, |
|
| 46 | - ]; |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 7 => 1, |
|
| 30 | + 10 => 1, |
|
| 31 | + 17 => 1, |
|
| 32 | + 20 => 1, |
|
| 33 | + 24 => 1, |
|
| 34 | + 25 => 1, |
|
| 35 | + 27 => 1, |
|
| 36 | + 28 => 1, |
|
| 37 | + 29 => 1, |
|
| 38 | + 30 => 1, |
|
| 39 | + 58 => 1, |
|
| 40 | + 123 => 1, |
|
| 41 | + 224 => 1, |
|
| 42 | + 225 => 1, |
|
| 43 | + 279 => 1, |
|
| 44 | + 284 => 1, |
|
| 45 | + 311 => 1, |
|
| 46 | + ]; |
|
| 47 | 47 | |
| 48 | - }//end getErrorList() |
|
| 48 | + }//end getErrorList() |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Returns the lines where warnings should occur. |
|
| 53 | - * |
|
| 54 | - * The key of the array should represent the line number and the value |
|
| 55 | - * should represent the number of warnings that should occur on that line. |
|
| 56 | - * |
|
| 57 | - * @return array<int, int> |
|
| 58 | - */ |
|
| 59 | - public function getWarningList() |
|
| 60 | - { |
|
| 61 | - return []; |
|
| 51 | + /** |
|
| 52 | + * Returns the lines where warnings should occur. |
|
| 53 | + * |
|
| 54 | + * The key of the array should represent the line number and the value |
|
| 55 | + * should represent the number of warnings that should occur on that line. |
|
| 56 | + * |
|
| 57 | + * @return array<int, int> |
|
| 58 | + */ |
|
| 59 | + public function getWarningList() |
|
| 60 | + { |
|
| 61 | + return []; |
|
| 62 | 62 | |
| 63 | - }//end getWarningList() |
|
| 63 | + }//end getWarningList() |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | }//end class |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | function hello3() |
| 33 | 33 | { |
| 34 | 34 | switch ($hello) { |
| 35 | - case 'hello': |
|
| 36 | - break; |
|
| 35 | + case 'hello': |
|
| 36 | + break; |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
@@ -79,20 +79,20 @@ discard block |
||
| 79 | 79 | } else if (FALSE) { |
| 80 | 80 | foreach ($tokens as $token) { |
| 81 | 81 | switch ($token) { |
| 82 | - case '1': |
|
| 83 | - case '2': |
|
| 84 | - if (true) { |
|
| 85 | - if (false) { |
|
| 86 | - if (false) { |
|
| 87 | - if (false) { |
|
| 88 | - echo 'hello'; |
|
| 89 | - } |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - } |
|
| 93 | - break; |
|
| 94 | - case '5': |
|
| 95 | - break; |
|
| 82 | + case '1': |
|
| 83 | + case '2': |
|
| 84 | + if (true) { |
|
| 85 | + if (false) { |
|
| 86 | + if (false) { |
|
| 87 | + if (false) { |
|
| 88 | + echo 'hello'; |
|
| 89 | + } |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | + break; |
|
| 94 | + case '5': |
|
| 95 | + break; |
|
| 96 | 96 | } |
| 97 | 97 | do { |
| 98 | 98 | while (true) { |
@@ -161,20 +161,20 @@ discard block |
||
| 161 | 161 | $last = count($ts) - 1; |
| 162 | 162 | |
| 163 | 163 | switch ($token) { |
| 164 | - case '(': |
|
| 164 | + case '(': |
|
| 165 | 165 | |
| 166 | - if ($last >= 3 && |
|
| 167 | - $ts[0]['token'] != T_CLASS && |
|
| 168 | - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
| 169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 166 | + if ($last >= 3 && |
|
| 167 | + $ts[0]['token'] != T_CLASS && |
|
| 168 | + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
| 169 | + $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | - if (true) { |
|
| 173 | - echo 'hello'; |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - array_push($braces, $token); |
|
| 177 | - break; |
|
| 172 | + if (true) { |
|
| 173 | + echo 'hello'; |
|
| 174 | + } |
|
| 175 | + } |
|
| 176 | + array_push($braces, $token); |
|
| 177 | + break; |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -256,19 +256,19 @@ discard block |
||
| 256 | 256 | switch ($foo) { |
| 257 | 257 | case 1: |
| 258 | 258 | switch ($bar) { |
| 259 | - default: |
|
| 260 | - echo $string{1}; |
|
| 259 | + default: |
|
| 260 | + echo $string{1}; |
|
| 261 | 261 | } |
| 262 | 262 | break; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | function temp($foo, $bar) { |
| 266 | 266 | switch ($foo) { |
| 267 | - case 1: |
|
| 268 | - switch ($bar) { |
|
| 269 | - default: |
|
| 270 | - return $foo; |
|
| 271 | - } |
|
| 267 | + case 1: |
|
| 268 | + switch ($bar) { |
|
| 269 | + default: |
|
| 270 | + return $foo; |
|
| 271 | + } |
|
| 272 | 272 | break; |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | do { // error here |
| 28 | 28 | echo 'hello'; // error here |
| 29 | - } while (TRUE); |
|
| 29 | + }while (TRUE); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | function hello3() |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | - } while (true); |
|
| 105 | + }while (true); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | if ($last >= 3 && |
| 167 | 167 | $ts[0]['token'] != T_CLASS && |
| 168 | 168 | $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
| 169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 169 | + $ts[$last - 3]['token'] == T_VARIABLE) { |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | if (true) { |
@@ -61,8 +61,12 @@ |
||
| 61 | 61 | public function open() |
| 62 | 62 | { |
| 63 | 63 | // Some inline stuff that shouldn't error |
| 64 | - if (TRUE) echo 'hello'; |
|
| 65 | - foreach ($tokens as $token) echo $token; |
|
| 64 | + if (TRUE) { |
|
| 65 | + echo 'hello'; |
|
| 66 | + } |
|
| 67 | + foreach ($tokens as $token) { |
|
| 68 | + echo $token; |
|
| 69 | + } |
|
| 66 | 70 | } |
| 67 | 71 | |
| 68 | 72 | /** |
@@ -2,40 +2,40 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | class Test |
| 4 | 4 | { |
| 5 | - function __construct() |
|
| 6 | - { |
|
| 7 | - $this->hello(); // error here |
|
| 8 | - } |
|
| 5 | + function __construct() |
|
| 6 | + { |
|
| 7 | + $this->hello(); // error here |
|
| 8 | + } |
|
| 9 | 9 | |
| 10 | 10 | function hello() // error here |
| 11 | - { // no error here as brackets can be put anywhere in the pear standard |
|
| 12 | - echo 'hello'; |
|
| 13 | - } |
|
| 14 | - |
|
| 15 | - function hello2() |
|
| 16 | - { |
|
| 17 | - if (TRUE) { // error here |
|
| 18 | - echo 'hello'; // no error here as its more than 4 spaces. |
|
| 19 | - } else { |
|
| 20 | - echo 'bye'; // error here |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - while (TRUE) { |
|
| 24 | - echo 'hello'; // error here |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - do { // error here |
|
| 28 | - echo 'hello'; // error here |
|
| 29 | - } while (TRUE); |
|
| 11 | + { // no error here as brackets can be put anywhere in the pear standard |
|
| 12 | + echo 'hello'; |
|
| 13 | + } |
|
| 14 | + |
|
| 15 | + function hello2() |
|
| 16 | + { |
|
| 17 | + if (TRUE) { // error here |
|
| 18 | + echo 'hello'; // no error here as its more than 4 spaces. |
|
| 19 | + } else { |
|
| 20 | + echo 'bye'; // error here |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + while (TRUE) { |
|
| 24 | + echo 'hello'; // error here |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + do { // error here |
|
| 28 | + echo 'hello'; // error here |
|
| 29 | + } while (TRUE); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - function hello3() |
|
| 33 | - { |
|
| 34 | - switch ($hello) { |
|
| 35 | - case 'hello': |
|
| 36 | - break; |
|
| 37 | - } |
|
| 38 | - } |
|
| 32 | + function hello3() |
|
| 33 | + { |
|
| 34 | + switch ($hello) { |
|
| 35 | + case 'hello': |
|
| 36 | + break; |
|
| 37 | + } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | <body> |
| 46 | 46 | <?php |
| 47 | 47 | if ($form->validate()) { |
| 48 | - $safe = $form->getSubmitValues(); |
|
| 48 | + $safe = $form->getSubmitValues(); |
|
| 49 | 49 | } |
| 50 | 50 | ?> |
| 51 | 51 | </pre> |
@@ -53,62 +53,62 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | class Test2 |
| 55 | 55 | { |
| 56 | - function __construct() |
|
| 57 | - { |
|
| 58 | - // $this->open(); // error here |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - public function open() |
|
| 62 | - { |
|
| 63 | - // Some inline stuff that shouldn't error |
|
| 64 | - if (TRUE) echo 'hello'; |
|
| 65 | - foreach ($tokens as $token) echo $token; |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * This is a comment 1. |
|
| 70 | - * This is a comment 2. |
|
| 71 | - * This is a comment 3. |
|
| 72 | - * This is a comment 4. |
|
| 73 | - */ |
|
| 74 | - public function close() |
|
| 75 | - { |
|
| 76 | - // All ok. |
|
| 77 | - if (TRUE) { |
|
| 78 | - if (TRUE) { |
|
| 79 | - } else if (FALSE) { |
|
| 80 | - foreach ($tokens as $token) { |
|
| 81 | - switch ($token) { |
|
| 82 | - case '1': |
|
| 83 | - case '2': |
|
| 84 | - if (true) { |
|
| 85 | - if (false) { |
|
| 86 | - if (false) { |
|
| 87 | - if (false) { |
|
| 88 | - echo 'hello'; |
|
| 89 | - } |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - } |
|
| 93 | - break; |
|
| 94 | - case '5': |
|
| 95 | - break; |
|
| 96 | - } |
|
| 97 | - do { |
|
| 98 | - while (true) { |
|
| 99 | - foreach ($tokens as $token) { |
|
| 100 | - for ($i = 0; $i < $token; $i++) { |
|
| 101 | - echo 'hello'; |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - } |
|
| 105 | - } while (true); |
|
| 106 | - } |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /* |
|
| 56 | + function __construct() |
|
| 57 | + { |
|
| 58 | + // $this->open(); // error here |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + public function open() |
|
| 62 | + { |
|
| 63 | + // Some inline stuff that shouldn't error |
|
| 64 | + if (TRUE) echo 'hello'; |
|
| 65 | + foreach ($tokens as $token) echo $token; |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * This is a comment 1. |
|
| 70 | + * This is a comment 2. |
|
| 71 | + * This is a comment 3. |
|
| 72 | + * This is a comment 4. |
|
| 73 | + */ |
|
| 74 | + public function close() |
|
| 75 | + { |
|
| 76 | + // All ok. |
|
| 77 | + if (TRUE) { |
|
| 78 | + if (TRUE) { |
|
| 79 | + } else if (FALSE) { |
|
| 80 | + foreach ($tokens as $token) { |
|
| 81 | + switch ($token) { |
|
| 82 | + case '1': |
|
| 83 | + case '2': |
|
| 84 | + if (true) { |
|
| 85 | + if (false) { |
|
| 86 | + if (false) { |
|
| 87 | + if (false) { |
|
| 88 | + echo 'hello'; |
|
| 89 | + } |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | + break; |
|
| 94 | + case '5': |
|
| 95 | + break; |
|
| 96 | + } |
|
| 97 | + do { |
|
| 98 | + while (true) { |
|
| 99 | + foreach ($tokens as $token) { |
|
| 100 | + for ($i = 0; $i < $token; $i++) { |
|
| 101 | + echo 'hello'; |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + } |
|
| 105 | + } while (true); |
|
| 106 | + } |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /* |
|
| 112 | 112 | This is another c style comment 1. |
| 113 | 113 | This is another c style comment 2. |
| 114 | 114 | This is another c style comment 3. |
@@ -116,74 +116,74 @@ discard block |
||
| 116 | 116 | This is another c style comment 5. |
| 117 | 117 | */ |
| 118 | 118 | |
| 119 | - /* |
|
| 119 | + /* |
|
| 120 | 120 | * |
| 121 | 121 | * |
| 122 | 122 | * |
| 123 | 123 | */ |
| 124 | 124 | |
| 125 | - /** |
|
| 126 | - */ |
|
| 125 | + /** |
|
| 126 | + */ |
|
| 127 | 127 | |
| 128 | - /* |
|
| 128 | + /* |
|
| 129 | 129 | This comment has a newline in it. |
| 130 | 130 | |
| 131 | 131 | */ |
| 132 | 132 | |
| 133 | - public function read() |
|
| 134 | - { |
|
| 135 | - echo 'hello'; |
|
| 136 | - |
|
| 137 | - // no errors below. |
|
| 138 | - $array = array( |
|
| 139 | - 'this', |
|
| 140 | - 'that' => array( |
|
| 141 | - 'hello', |
|
| 142 | - 'hello again' => array( |
|
| 143 | - 'hello', |
|
| 144 | - ), |
|
| 145 | - ), |
|
| 146 | - ); |
|
| 147 | - } |
|
| 133 | + public function read() |
|
| 134 | + { |
|
| 135 | + echo 'hello'; |
|
| 136 | + |
|
| 137 | + // no errors below. |
|
| 138 | + $array = array( |
|
| 139 | + 'this', |
|
| 140 | + 'that' => array( |
|
| 141 | + 'hello', |
|
| 142 | + 'hello again' => array( |
|
| 143 | + 'hello', |
|
| 144 | + ), |
|
| 145 | + ), |
|
| 146 | + ); |
|
| 147 | + } |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | abstract class Test3 |
| 151 | 151 | { |
| 152 | - public function parse() |
|
| 153 | - { |
|
| 154 | - |
|
| 155 | - foreach ($t as $ndx => $token) { |
|
| 156 | - if (is_array($token)) { |
|
| 157 | - echo 'here'; |
|
| 158 | - } else { |
|
| 159 | - $ts[] = array("token" => $token, "value" => ''); |
|
| 160 | - |
|
| 161 | - $last = count($ts) - 1; |
|
| 162 | - |
|
| 163 | - switch ($token) { |
|
| 164 | - case '(': |
|
| 165 | - |
|
| 166 | - if ($last >= 3 && |
|
| 167 | - $ts[0]['token'] != T_CLASS && |
|
| 168 | - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
| 169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 170 | - |
|
| 171 | - |
|
| 172 | - if (true) { |
|
| 173 | - echo 'hello'; |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - array_push($braces, $token); |
|
| 177 | - break; |
|
| 178 | - } |
|
| 179 | - } |
|
| 180 | - } |
|
| 181 | - } |
|
| 152 | + public function parse() |
|
| 153 | + { |
|
| 154 | + |
|
| 155 | + foreach ($t as $ndx => $token) { |
|
| 156 | + if (is_array($token)) { |
|
| 157 | + echo 'here'; |
|
| 158 | + } else { |
|
| 159 | + $ts[] = array("token" => $token, "value" => ''); |
|
| 160 | + |
|
| 161 | + $last = count($ts) - 1; |
|
| 162 | + |
|
| 163 | + switch ($token) { |
|
| 164 | + case '(': |
|
| 165 | + |
|
| 166 | + if ($last >= 3 && |
|
| 167 | + $ts[0]['token'] != T_CLASS && |
|
| 168 | + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
| 169 | + $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 170 | + |
|
| 171 | + |
|
| 172 | + if (true) { |
|
| 173 | + echo 'hello'; |
|
| 174 | + } |
|
| 175 | + } |
|
| 176 | + array_push($braces, $token); |
|
| 177 | + break; |
|
| 178 | + } |
|
| 179 | + } |
|
| 180 | + } |
|
| 181 | + } |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | function test() |
| 185 | 185 | { |
| 186 | - $o = <<<EOF |
|
| 186 | + $o = <<<EOF |
|
| 187 | 187 | this is some text |
| 188 | 188 | this is some text |
| 189 | 189 | this is some text |
@@ -192,24 +192,24 @@ discard block |
||
| 192 | 192 | this is some text |
| 193 | 193 | EOF; |
| 194 | 194 | |
| 195 | - return $o; |
|
| 195 | + return $o; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if ($a === true || $a === true || $a === true || $a === true || |
| 199 | - $a === true || $a === true || $a === true || $a === true) { |
|
| 199 | + $a === true || $a === true || $a === true || $a === true) { |
|
| 200 | 200 | |
| 201 | - echo 'hello'; |
|
| 201 | + echo 'hello'; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | if ($true) { |
| 205 | - /* First comment line |
|
| 205 | + /* First comment line |
|
| 206 | 206 | * |
| 207 | 207 | * Comment test here |
| 208 | 208 | * Comment test here |
| 209 | 209 | * |
| 210 | 210 | */ |
| 211 | 211 | |
| 212 | - /* First comment line |
|
| 212 | + /* First comment line |
|
| 213 | 213 | * |
| 214 | 214 | * Comment test here |
| 215 | 215 | * Comment test here |
@@ -219,80 +219,80 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | function test() |
| 221 | 221 | { |
| 222 | - /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
| 223 | - # $m[] = 'declare'; |
|
| 222 | + /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
| 223 | + # $m[] = 'declare'; |
|
| 224 | 224 | /* taken from http://de3.php.net/manual/en/reserved.php */ |
| 225 | 225 | # $m[] = 'declare'; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | foreach ($elements as $element) { |
| 229 | - if ($something) { |
|
| 230 | - // Do IF. |
|
| 231 | - } else if ($somethingElse) { |
|
| 232 | - // Do ELSE. |
|
| 233 | - } |
|
| 229 | + if ($something) { |
|
| 230 | + // Do IF. |
|
| 231 | + } else if ($somethingElse) { |
|
| 232 | + // Do ELSE. |
|
| 233 | + } |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if ($condition) { |
| 237 | - echo "This is a long |
|
| 237 | + echo "This is a long |
|
| 238 | 238 | string that spans $numLines lines |
| 239 | 239 | without indenting. |
| 240 | 240 | "; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if ($condition) { |
| 244 | - echo 'This is a long |
|
| 244 | + echo 'This is a long |
|
| 245 | 245 | string that spans multiple lines |
| 246 | 246 | with indenting. |
| 247 | 247 | '; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if ($condition) { |
| 251 | - echo 'This is a long |
|
| 251 | + echo 'This is a long |
|
| 252 | 252 | string that spans multiple lines |
| 253 | 253 | with indenting.'; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | switch ($foo) { |
| 257 | 257 | case 1: |
| 258 | - switch ($bar) { |
|
| 259 | - default: |
|
| 260 | - echo $string{1}; |
|
| 261 | - } |
|
| 262 | - break; |
|
| 258 | + switch ($bar) { |
|
| 259 | + default: |
|
| 260 | + echo $string{1}; |
|
| 261 | + } |
|
| 262 | + break; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | function temp($foo, $bar) { |
| 266 | - switch ($foo) { |
|
| 267 | - case 1: |
|
| 268 | - switch ($bar) { |
|
| 269 | - default: |
|
| 270 | - return $foo; |
|
| 271 | - } |
|
| 272 | - break; |
|
| 273 | - } |
|
| 266 | + switch ($foo) { |
|
| 267 | + case 1: |
|
| 268 | + switch ($bar) { |
|
| 269 | + default: |
|
| 270 | + return $foo; |
|
| 271 | + } |
|
| 272 | + break; |
|
| 273 | + } |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | switch ($foo) { |
| 277 | 277 | case 1: |
| 278 | - switch ($bar) { |
|
| 279 | - default: |
|
| 280 | - if ($something) { |
|
| 281 | - echo $string{1}; |
|
| 282 | - } else if ($else) { |
|
| 283 | - switch ($else) { |
|
| 284 | - default: |
|
| 285 | - } |
|
| 286 | - } |
|
| 287 | - } |
|
| 288 | - break; |
|
| 278 | + switch ($bar) { |
|
| 279 | + default: |
|
| 280 | + if ($something) { |
|
| 281 | + echo $string{1}; |
|
| 282 | + } else if ($else) { |
|
| 283 | + switch ($else) { |
|
| 284 | + default: |
|
| 285 | + } |
|
| 286 | + } |
|
| 287 | + } |
|
| 288 | + break; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | switch ($name) { |
| 292 | 292 | case "1": |
| 293 | 293 | case "2": |
| 294 | 294 | case "3": |
| 295 | - return true; |
|
| 295 | + return true; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | switch ($name) { |
@@ -300,15 +300,15 @@ discard block |
||
| 300 | 300 | case "2": |
| 301 | 301 | case "3": |
| 302 | 302 | default : |
| 303 | - return true; |
|
| 303 | + return true; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // Don't check the first token in the closure. |
| 307 | 307 | $array = array(); |
| 308 | 308 | array_map( |
| 309 | - function($x) |
|
| 310 | - { |
|
| 311 | - return trim($x); |
|
| 312 | - }, |
|
| 313 | - $array |
|
| 309 | + function($x) |
|
| 310 | + { |
|
| 311 | + return trim($x); |
|
| 312 | + }, |
|
| 313 | + $array |
|
| 314 | 314 | ); |
| 315 | 315 | \ No newline at end of file |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | switch ($foo) { |
| 49 | 49 | case 1: |
| 50 | 50 | switch ($bar) { |
| 51 | - default: |
|
| 52 | - if ($something) { |
|
| 53 | - echo $string{1}; |
|
| 54 | - } else if ($else) { |
|
| 55 | - switch ($else) { |
|
| 56 | - case 1: |
|
| 57 | - // Do something. |
|
| 58 | - break; |
|
| 59 | - default: |
|
| 60 | - // Do something. |
|
| 61 | - break; |
|
| 62 | - } |
|
| 51 | + default: |
|
| 52 | + if ($something) { |
|
| 53 | + echo $string{1}; |
|
| 54 | + } else if ($else) { |
|
| 55 | + switch ($else) { |
|
| 56 | + case 1: |
|
| 57 | + // Do something. |
|
| 58 | + break; |
|
| 59 | + default: |
|
| 60 | + // Do something. |
|
| 61 | + break; |
|
| 62 | + } |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | break; |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | switch ($httpResponseCode) { |
| 72 | - case 100: |
|
| 73 | - case 101: |
|
| 74 | - case 102: |
|
| 75 | - default: |
|
| 76 | - return 'Unknown'; |
|
| 72 | + case 100: |
|
| 73 | + case 101: |
|
| 74 | + case 102: |
|
| 75 | + default: |
|
| 76 | + return 'Unknown'; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | switch ($httpResponseCode) { |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | $chr = $str{0}; } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | - if (!class_exists($class_name)) { |
|
| 33 | + if ( ! class_exists($class_name)) { |
|
| 34 | 34 | echo $error; |
| 35 | 35 | } |
| 36 | - $this->{$property} =& new $class_name($this->db_index); |
|
| 37 | - $this->modules[$module] =& $this->{$property}; |
|
| 36 | + $this->{$property} = & new $class_name($this->db_index); |
|
| 37 | + $this->modules[$module] = & $this->{$property}; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | foreach ($elements as $element) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | return 'Unknown'; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | -switch($i) { |
|
| 88 | +switch ($i) { |
|
| 89 | 89 | case 1: {} |
| 90 | 90 | } |
| 91 | 91 | |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | <?php endforeach ?> |
| 128 | 128 | </ul> |
| 129 | 129 | <?php |
| 130 | -switch ( $a ) { |
|
| 130 | +switch ($a) { |
|
| 131 | 131 | case 'foo': |
| 132 | 132 | do { |
| 133 | 133 | $a = 'b'; |
| 134 | - } while ( $a ); |
|
| 134 | + }while ($a); |
|
| 135 | 135 | return 5; |
| 136 | 136 | |
| 137 | 137 | case 'bar': |
| 138 | - foreach ( $a as $b ) { |
|
| 138 | + foreach ($a as $b) { |
|
| 139 | 139 | $e = 'b'; |
| 140 | 140 | } |
| 141 | 141 | return 5; |
@@ -2,19 +2,19 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | class Test |
| 4 | 4 | { |
| 5 | - public function __construct() |
|
| 6 | - { |
|
| 7 | - } |
|
| 5 | + public function __construct() |
|
| 6 | + { |
|
| 7 | + } |
|
| 8 | 8 | |
| 9 | - function test1() |
|
| 10 | - { |
|
| 11 | - } |
|
| 9 | + function test1() |
|
| 10 | + { |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | - function test2() {} |
|
| 13 | + function test2() {} |
|
| 14 | 14 | |
| 15 | - private function _test3() |
|
| 16 | - { |
|
| 17 | - } |
|
| 15 | + private function _test3() |
|
| 16 | + { |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | 19 | } |
| 20 | 20 | |
@@ -26,63 +26,63 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | function test2() |
| 28 | 28 | { |
| 29 | - if ($str{0}) { |
|
| 30 | - $chr = $str{0}; } |
|
| 29 | + if ($str{0}) { |
|
| 30 | + $chr = $str{0}; } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - if (!class_exists($class_name)) { |
|
| 34 | - echo $error; |
|
| 35 | - } |
|
| 36 | - $this->{$property} =& new $class_name($this->db_index); |
|
| 37 | - $this->modules[$module] =& $this->{$property}; |
|
| 33 | + if (!class_exists($class_name)) { |
|
| 34 | + echo $error; |
|
| 35 | + } |
|
| 36 | + $this->{$property} =& new $class_name($this->db_index); |
|
| 37 | + $this->modules[$module] =& $this->{$property}; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | foreach ($elements as $element) { |
| 41 | - if ($something) { |
|
| 42 | - // Do IF. |
|
| 43 | - } else if ($somethingElse) { |
|
| 44 | - // Do ELSE. |
|
| 45 | - } |
|
| 41 | + if ($something) { |
|
| 42 | + // Do IF. |
|
| 43 | + } else if ($somethingElse) { |
|
| 44 | + // Do ELSE. |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | switch ($foo) { |
| 49 | 49 | case 1: |
| 50 | - switch ($bar) { |
|
| 51 | - default: |
|
| 52 | - if ($something) { |
|
| 53 | - echo $string{1}; |
|
| 54 | - } else if ($else) { |
|
| 55 | - switch ($else) { |
|
| 56 | - case 1: |
|
| 57 | - // Do something. |
|
| 58 | - break; |
|
| 59 | - default: |
|
| 60 | - // Do something. |
|
| 61 | - break; |
|
| 62 | - } |
|
| 63 | - } |
|
| 64 | - } |
|
| 50 | + switch ($bar) { |
|
| 51 | + default: |
|
| 52 | + if ($something) { |
|
| 53 | + echo $string{1}; |
|
| 54 | + } else if ($else) { |
|
| 55 | + switch ($else) { |
|
| 56 | + case 1: |
|
| 57 | + // Do something. |
|
| 58 | + break; |
|
| 59 | + default: |
|
| 60 | + // Do something. |
|
| 61 | + break; |
|
| 62 | + } |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | 65 | break; |
| 66 | 66 | case 2: |
| 67 | - // Do something; |
|
| 68 | - break; |
|
| 67 | + // Do something; |
|
| 68 | + break; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | switch ($httpResponseCode) { |
| 72 | - case 100: |
|
| 73 | - case 101: |
|
| 74 | - case 102: |
|
| 75 | - default: |
|
| 76 | - return 'Unknown'; |
|
| 72 | + case 100: |
|
| 73 | + case 101: |
|
| 74 | + case 102: |
|
| 75 | + default: |
|
| 76 | + return 'Unknown'; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | switch ($httpResponseCode) { |
| 80 | - case 100: |
|
| 81 | - case 101: |
|
| 82 | - case 102: |
|
| 83 | - return 'Processing.'; |
|
| 84 | - default: |
|
| 85 | - return 'Unknown'; |
|
| 80 | + case 100: |
|
| 81 | + case 101: |
|
| 82 | + case 102: |
|
| 83 | + return 'Processing.'; |
|
| 84 | + default: |
|
| 85 | + return 'Unknown'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | switch($i) { |
@@ -90,20 +90,20 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | switch ($httpResponseCode) { |
| 93 | - case 100: |
|
| 94 | - case 101: |
|
| 95 | - case 102: |
|
| 96 | - exit; |
|
| 97 | - default: |
|
| 98 | - exit; |
|
| 93 | + case 100: |
|
| 94 | + case 101: |
|
| 95 | + case 102: |
|
| 96 | + exit; |
|
| 97 | + default: |
|
| 98 | + exit; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | if ($foo): |
| 102 | - if ($bar): |
|
| 103 | - $foo = 1; |
|
| 104 | - elseif ($baz): |
|
| 105 | - $foo = 2; |
|
| 106 | - endif; |
|
| 102 | + if ($bar): |
|
| 103 | + $foo = 1; |
|
| 104 | + elseif ($baz): |
|
| 105 | + $foo = 2; |
|
| 106 | + endif; |
|
| 107 | 107 | endif; |
| 108 | 108 | |
| 109 | 109 | if ($foo): |
@@ -128,17 +128,17 @@ discard block |
||
| 128 | 128 | </ul> |
| 129 | 129 | <?php |
| 130 | 130 | switch ( $a ) { |
| 131 | - case 'foo': |
|
| 132 | - do { |
|
| 133 | - $a = 'b'; |
|
| 134 | - } while ( $a ); |
|
| 135 | - return 5; |
|
| 136 | - |
|
| 137 | - case 'bar': |
|
| 138 | - foreach ( $a as $b ) { |
|
| 139 | - $e = 'b'; |
|
| 140 | - } |
|
| 141 | - return 5; |
|
| 131 | + case 'foo': |
|
| 132 | + do { |
|
| 133 | + $a = 'b'; |
|
| 134 | + } while ( $a ); |
|
| 135 | + return 5; |
|
| 136 | + |
|
| 137 | + case 'bar': |
|
| 138 | + foreach ( $a as $b ) { |
|
| 139 | + $e = 'b'; |
|
| 140 | + } |
|
| 141 | + return 5; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | ?> |
@@ -149,9 +149,9 @@ discard block |
||
| 149 | 149 | $match = match ($test) { 1 => 'a', 2 => 'b' }; |
| 150 | 150 | |
| 151 | 151 | $match = match ($test) { |
| 152 | - 1 => 'a', |
|
| 153 | - 2 => 'b' |
|
| 154 | - }; |
|
| 152 | + 1 => 'a', |
|
| 153 | + 2 => 'b' |
|
| 154 | + }; |
|
| 155 | 155 | |
| 156 | 156 | enum Enum |
| 157 | 157 | { |
@@ -161,4 +161,4 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | enum Cards |
| 163 | 163 | { |
| 164 | - } |
|
| 164 | + } |
|
@@ -15,38 +15,38 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 3 => 1, |
|
| 30 | - 6 => 1, |
|
| 31 | - 8 => 1, |
|
| 32 | - ]; |
|
| 33 | - |
|
| 34 | - }//end getErrorList() |
|
| 35 | - |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * Returns the lines where warnings should occur. |
|
| 39 | - * |
|
| 40 | - * The key of the array should represent the line number and the value |
|
| 41 | - * should represent the number of warnings that should occur on that line. |
|
| 42 | - * |
|
| 43 | - * @return array<int, int> |
|
| 44 | - */ |
|
| 45 | - public function getWarningList() |
|
| 46 | - { |
|
| 47 | - return []; |
|
| 48 | - |
|
| 49 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 3 => 1, |
|
| 30 | + 6 => 1, |
|
| 31 | + 8 => 1, |
|
| 32 | + ]; |
|
| 33 | + |
|
| 34 | + }//end getErrorList() |
|
| 35 | + |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * Returns the lines where warnings should occur. |
|
| 39 | + * |
|
| 40 | + * The key of the array should represent the line number and the value |
|
| 41 | + * should represent the number of warnings that should occur on that line. |
|
| 42 | + * |
|
| 43 | + * @return array<int, int> |
|
| 44 | + */ |
|
| 45 | + public function getWarningList() |
|
| 46 | + { |
|
| 47 | + return []; |
|
| 48 | + |
|
| 49 | + }//end getWarningList() |
|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | }//end class |
@@ -15,53 +15,53 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 4 => 1, |
|
| 30 | - 5 => 1, |
|
| 31 | - 11 => 1, |
|
| 32 | - 12 => 1, |
|
| 33 | - 16 => 1, |
|
| 34 | - 17 => 1, |
|
| 35 | - 33 => 1, |
|
| 36 | - 34 => 1, |
|
| 37 | - 47 => 1, |
|
| 38 | - 48 => 1, |
|
| 39 | - 64 => 1, |
|
| 40 | - 65 => 1, |
|
| 41 | - 73 => 1, |
|
| 42 | - 74 => 1, |
|
| 43 | - 85 => 1, |
|
| 44 | - 86 => 1, |
|
| 45 | - 98 => 1, |
|
| 46 | - 99 => 2, |
|
| 47 | - ]; |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 4 => 1, |
|
| 30 | + 5 => 1, |
|
| 31 | + 11 => 1, |
|
| 32 | + 12 => 1, |
|
| 33 | + 16 => 1, |
|
| 34 | + 17 => 1, |
|
| 35 | + 33 => 1, |
|
| 36 | + 34 => 1, |
|
| 37 | + 47 => 1, |
|
| 38 | + 48 => 1, |
|
| 39 | + 64 => 1, |
|
| 40 | + 65 => 1, |
|
| 41 | + 73 => 1, |
|
| 42 | + 74 => 1, |
|
| 43 | + 85 => 1, |
|
| 44 | + 86 => 1, |
|
| 45 | + 98 => 1, |
|
| 46 | + 99 => 2, |
|
| 47 | + ]; |
|
| 48 | 48 | |
| 49 | - }//end getErrorList() |
|
| 49 | + }//end getErrorList() |
|
| 50 | 50 | |
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Returns the lines where warnings should occur. |
|
| 54 | - * |
|
| 55 | - * The key of the array should represent the line number and the value |
|
| 56 | - * should represent the number of warnings that should occur on that line. |
|
| 57 | - * |
|
| 58 | - * @return array<int, int> |
|
| 59 | - */ |
|
| 60 | - public function getWarningList() |
|
| 61 | - { |
|
| 62 | - return []; |
|
| 52 | + /** |
|
| 53 | + * Returns the lines where warnings should occur. |
|
| 54 | + * |
|
| 55 | + * The key of the array should represent the line number and the value |
|
| 56 | + * should represent the number of warnings that should occur on that line. |
|
| 57 | + * |
|
| 58 | + * @return array<int, int> |
|
| 59 | + */ |
|
| 60 | + public function getWarningList() |
|
| 61 | + { |
|
| 62 | + return []; |
|
| 63 | 63 | |
| 64 | - }//end getWarningList() |
|
| 64 | + }//end getWarningList() |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | }//end class |
@@ -8,8 +8,8 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | // Conditionally including a class file: use include_once |
| 10 | 10 | if ($test) { |
| 11 | - require_once 'blank.inc'; |
|
| 12 | - require 'blank.inc'; |
|
| 11 | + require_once 'blank.inc'; |
|
| 12 | + require 'blank.inc'; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // Unconditionally including a class file: use require_once |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // These are ok |
| 21 | 21 | if ($test) { |
| 22 | - include_once 'blank.inc'; |
|
| 23 | - include 'blank.inc'; |
|
| 22 | + include_once 'blank.inc'; |
|
| 23 | + include 'blank.inc'; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | require_once 'blank.inc'; |
@@ -39,54 +39,54 @@ discard block |
||
| 39 | 39 | <?php |
| 40 | 40 | |
| 41 | 41 | if (include_once 'blank.inc') { |
| 42 | - $var = include_once 'blank.inc'; |
|
| 43 | - if ($var === true) { |
|
| 44 | - } |
|
| 42 | + $var = include_once 'blank.inc'; |
|
| 43 | + if ($var === true) { |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if (require_once 'blank.inc') { |
| 48 | - $var = require_once 'blank.inc'; |
|
| 49 | - if ($var === true) { |
|
| 50 | - } |
|
| 48 | + $var = require_once 'blank.inc'; |
|
| 49 | + if ($var === true) { |
|
| 50 | + } |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | function get_some_value() |
| 54 | 54 | { |
| 55 | - include_once 'blank.inc'; |
|
| 56 | - include 'blank.inc'; |
|
| 55 | + include_once 'blank.inc'; |
|
| 56 | + include 'blank.inc'; |
|
| 57 | 57 | |
| 58 | - // These are ok |
|
| 59 | - if ($test) { |
|
| 60 | - include_once 'blank.inc'; |
|
| 61 | - include 'blank.inc'; |
|
| 62 | - } |
|
| 58 | + // These are ok |
|
| 59 | + if ($test) { |
|
| 60 | + include_once 'blank.inc'; |
|
| 61 | + include 'blank.inc'; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - require_once 'blank.inc'; |
|
| 65 | - require 'blank.inc'; |
|
| 64 | + require_once 'blank.inc'; |
|
| 65 | + require 'blank.inc'; |
|
| 66 | 66 | |
| 67 | - ?> |
|
| 67 | + ?> |
|
| 68 | 68 | <pre> |
| 69 | 69 | Some content goes here. |
| 70 | 70 | <?php |
| 71 | - include_once 'blank.inc'; |
|
| 72 | - include 'blank.inc'; |
|
| 73 | - require_once 'blank.inc'; |
|
| 74 | - require 'blank.inc'; |
|
| 75 | - ?> |
|
| 71 | + include_once 'blank.inc'; |
|
| 72 | + include 'blank.inc'; |
|
| 73 | + require_once 'blank.inc'; |
|
| 74 | + require 'blank.inc'; |
|
| 75 | + ?> |
|
| 76 | 76 | </pre> |
| 77 | 77 | <?php |
| 78 | 78 | |
| 79 | - if (include_once 'blank.inc') { |
|
| 80 | - $var = include_once 'blank.inc'; |
|
| 81 | - if ($var === true) { |
|
| 82 | - } |
|
| 83 | - } |
|
| 79 | + if (include_once 'blank.inc') { |
|
| 80 | + $var = include_once 'blank.inc'; |
|
| 81 | + if ($var === true) { |
|
| 82 | + } |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - if (require_once 'blank.inc') { |
|
| 86 | - $var = require_once 'blank.inc'; |
|
| 87 | - if ($var === true) { |
|
| 88 | - } |
|
| 89 | - } |
|
| 85 | + if (require_once 'blank.inc') { |
|
| 86 | + $var = require_once 'blank.inc'; |
|
| 87 | + if ($var === true) { |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | <?php } |
| 4 | 4 | |
| 5 | 5 | if (($condition1 |
| 6 | - || $condition2) |
|
| 7 | - && $condition3 |
|
| 8 | - && $condition4 |
|
| 9 | - && $condition5 |
|
| 6 | + || $condition2) |
|
| 7 | + && $condition3 |
|
| 8 | + && $condition4 |
|
| 9 | + && $condition5 |
|
| 10 | 10 | ) { |
| 11 | 11 | } |
| 12 | 12 | |
@@ -14,238 +14,238 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | if (($condition1 || $condition2) |
| 17 | - && $condition3 |
|
| 17 | + && $condition3 |
|
| 18 | 18 | ) { |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | if ( |
| 22 | - ($condition1 || $condition2) |
|
| 23 | - && $condition3 |
|
| 22 | + ($condition1 || $condition2) |
|
| 23 | + && $condition3 |
|
| 24 | 24 | ) { |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | if (($condition1 |
| 28 | - || $condition2) |
|
| 28 | + || $condition2) |
|
| 29 | 29 | ) { |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | if (($condition1 |
| 33 | - || $condition2) |
|
| 34 | - && $condition3 && |
|
| 35 | - $condition4 |
|
| 33 | + || $condition2) |
|
| 34 | + && $condition3 && |
|
| 35 | + $condition4 |
|
| 36 | 36 | ) { |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | if (($condition1 |
| 40 | 40 | || $condition2) |
| 41 | - && $condition3 |
|
| 41 | + && $condition3 |
|
| 42 | 42 | && $condition4 |
| 43 | 43 | && $condition5 |
| 44 | 44 | ) { |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if (($condition1 |
| 48 | - || $condition2) |
|
| 48 | + || $condition2) |
|
| 49 | 49 | ) { |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (($condition1 |
| 53 | - || $condition2) |
|
| 53 | + || $condition2) |
|
| 54 | 54 | ) { |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | if ( |
| 58 | - ( |
|
| 59 | - $condition1 |
|
| 60 | - || $condition2 |
|
| 61 | - ) |
|
| 62 | - && $condition3 |
|
| 58 | + ( |
|
| 59 | + $condition1 |
|
| 60 | + || $condition2 |
|
| 61 | + ) |
|
| 62 | + && $condition3 |
|
| 63 | 63 | ) { |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | if ( $condition1 |
| 68 | - || $condition2 |
|
| 69 | - || $condition3 |
|
| 68 | + || $condition2 |
|
| 69 | + || $condition3 |
|
| 70 | 70 | ) { |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | if ($condition1 |
| 74 | - || $condition2 |
|
| 75 | - || $condition3 |
|
| 74 | + || $condition2 |
|
| 75 | + || $condition3 |
|
| 76 | 76 | ) { |
| 77 | 77 | } else if ($condition1 |
| 78 | - || $condition2 |
|
| 79 | - || $condition3 |
|
| 78 | + || $condition2 |
|
| 79 | + || $condition3 |
|
| 80 | 80 | ) { |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if ($condition1 |
| 84 | - || $condition2 |
|
| 85 | - || $condition3 |
|
| 84 | + || $condition2 |
|
| 85 | + || $condition3 |
|
| 86 | 86 | ) { |
| 87 | 87 | } elseif ( |
| 88 | - $condition1 |
|
| 88 | + $condition1 |
|
| 89 | 89 | || $condition2 && |
| 90 | - $condition3 |
|
| 90 | + $condition3 |
|
| 91 | 91 | ) { |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | if ($condition1 |
| 95 | - || $condition2 |
|
| 95 | + || $condition2 |
|
| 96 | 96 | || $condition3) { |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | if ($condition1 |
| 100 | - || $condition2 || $condition3 |
|
| 100 | + || $condition2 || $condition3 |
|
| 101 | 101 | ){ |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ($condition1) |
| 105 | - echo 'bar'; |
|
| 105 | + echo 'bar'; |
|
| 106 | 106 | |
| 107 | 107 | if ($condition1 |
| 108 | - || $condition2 |
|
| 108 | + || $condition2 |
|
| 109 | 109 | || $condition3) |
| 110 | - echo 'bar'; |
|
| 110 | + echo 'bar'; |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | if ($condition1 |
| 114 | - || $condition2 || $condition3 |
|
| 114 | + || $condition2 || $condition3 |
|
| 115 | 115 | ) |
| 116 | - echo 'bar'; |
|
| 116 | + echo 'bar'; |
|
| 117 | 117 | |
| 118 | 118 | if (!empty($post) |
| 119 | - && (!empty($context['header']) |
|
| 120 | - xor stripos($context['header'], 'Content-Type')) |
|
| 119 | + && (!empty($context['header']) |
|
| 120 | + xor stripos($context['header'], 'Content-Type')) |
|
| 121 | 121 | ) { |
| 122 | 122 | // ... |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ($foo) |
| 126 | 126 | { |
| 127 | - echo 'bar'; |
|
| 127 | + echo 'bar'; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // Should be no errors even though lines are |
| 131 | 131 | // not exactly aligned together. Multi-line function |
| 132 | 132 | // call takes precedence. |
| 133 | 133 | if (array_key_exists($key, $value) |
| 134 | - && array_key_exists( |
|
| 135 | - $key, $value2 |
|
| 136 | - ) |
|
| 134 | + && array_key_exists( |
|
| 135 | + $key, $value2 |
|
| 136 | + ) |
|
| 137 | 137 | ) { |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if (true) : |
| 141 | - $foo = true; |
|
| 141 | + $foo = true; |
|
| 142 | 142 | endif; |
| 143 | 143 | |
| 144 | 144 | if ($IPP->errorCode() == 401 || // comment |
| 145 | - $IPP->errorCode() == 3200) /* long comment |
|
| 145 | + $IPP->errorCode() == 3200) /* long comment |
|
| 146 | 146 | here |
| 147 | 147 | */ |
| 148 | 148 | { |
| 149 | - return false; |
|
| 149 | + return false; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if ($IPP->errorCode() == 401 || // comment |
| 153 | - $IPP->errorCode() == 3200) // long comment here |
|
| 153 | + $IPP->errorCode() == 3200) // long comment here |
|
| 154 | 154 | { |
| 155 | - return false; |
|
| 155 | + return false; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if ($IPP->errorCode() == 401 |
| 159 | - // Comment explaining the next condition here. |
|
| 160 | - || $IPP->errorCode() == 3200 |
|
| 159 | + // Comment explaining the next condition here. |
|
| 160 | + || $IPP->errorCode() == 3200 |
|
| 161 | 161 | ) { |
| 162 | - return false; |
|
| 162 | + return false; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | function bar() { |
| 166 | - if ($a |
|
| 167 | - && $b |
|
| 166 | + if ($a |
|
| 167 | + && $b |
|
| 168 | 168 | ) { |
| 169 | - return false; |
|
| 170 | - } |
|
| 169 | + return false; |
|
| 170 | + } |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if ($a |
| 174 | - && foo( |
|
| 175 | - 'a', |
|
| 176 | - 'b' |
|
| 177 | - )) { |
|
| 178 | - return false; |
|
| 174 | + && foo( |
|
| 175 | + 'a', |
|
| 176 | + 'b' |
|
| 177 | + )) { |
|
| 178 | + return false; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | ?> |
| 182 | 182 | <?php foreach ($blah as $boo) : ?> |
| 183 | 183 | <?php if ($foo): ?> |
| 184 | 184 | <?php |
| 185 | - if ($bar) { |
|
| 186 | - } else { |
|
| 187 | - } |
|
| 188 | - ?> |
|
| 185 | + if ($bar) { |
|
| 186 | + } else { |
|
| 187 | + } |
|
| 188 | + ?> |
|
| 189 | 189 | <?php endif; ?> |
| 190 | 190 | <?php endforeach; ?> |
| 191 | 191 | <?php |
| 192 | 192 | |
| 193 | 193 | if ($IPP->errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. |
| 194 | - $IPP->errorCode() == 3200) /* |
|
| 194 | + $IPP->errorCode() == 3200) /* |
|
| 195 | 195 | phpcs:ignore Standard.Category.Sniff -- for reasons. |
| 196 | 196 | */ |
| 197 | 197 | { |
| 198 | - return false; |
|
| 198 | + return false; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. |
| 202 | - $IPP->errorCode() == 3200) // phpcs:enable |
|
| 202 | + $IPP->errorCode() == 3200) // phpcs:enable |
|
| 203 | 203 | { |
| 204 | - return false; |
|
| 204 | + return false; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if ($IPP->errorCode() == 401 |
| 208 | - // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
| 209 | - || $IPP->errorCode() == 3200 |
|
| 208 | + // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
| 209 | + || $IPP->errorCode() == 3200 |
|
| 210 | 210 | ) { |
| 211 | - return false; |
|
| 211 | + return false; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if ($IPP->errorCode() == 401 || |
|
| 215 | - /* |
|
| 214 | + if ($IPP->errorCode() == 401 || |
|
| 215 | + /* |
|
| 216 | 216 | * phpcs:disable Standard.Category.Sniff -- for reasons. |
| 217 | 217 | */ |
| 218 | - $IPP->errorCode() == 3200 |
|
| 219 | - ) { |
|
| 220 | - return false; |
|
| 221 | - } |
|
| 218 | + $IPP->errorCode() == 3200 |
|
| 219 | + ) { |
|
| 220 | + return false; |
|
| 221 | + } |
|
| 222 | 222 | |
| 223 | 223 | if ($IPP->errorCode() == 401 |
| 224 | - || $IPP->errorCode() == 3200 |
|
| 225 | - // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
| 224 | + || $IPP->errorCode() == 3200 |
|
| 225 | + // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
| 226 | 226 | ) { |
| 227 | - return false; |
|
| 227 | + return false; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | if ($IPP->errorCode() == 401 |
| 231 | - || $IPP->errorCode() |
|
| 232 | - === 'someverylongexpectedoutput' |
|
| 231 | + || $IPP->errorCode() |
|
| 232 | + === 'someverylongexpectedoutput' |
|
| 233 | 233 | ) { |
| 234 | - return false; |
|
| 234 | + return false; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | if ($IPP->errorCode() == 401 |
| 238 | - || $IPP->errorCode() |
|
| 239 | - // A comment. |
|
| 240 | - === 'someverylongexpectedoutput' |
|
| 238 | + || $IPP->errorCode() |
|
| 239 | + // A comment. |
|
| 240 | + === 'someverylongexpectedoutput' |
|
| 241 | 241 | ) { |
| 242 | - return false; |
|
| 242 | + return false; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | if ($IPP->errorCode() == 401 |
| 246 | - || $IPP->errorCode() |
|
| 247 | - // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
| 248 | - === 'someverylongexpectedoutput' |
|
| 246 | + || $IPP->errorCode() |
|
| 247 | + // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
| 248 | + === 'someverylongexpectedoutput' |
|
| 249 | 249 | ) { |
| 250 | - return false; |
|
| 250 | + return false; |
|
| 251 | 251 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if (($condition1 |
| 48 | 48 | || $condition2) |
| 49 | -) { |
|
| 49 | +) { |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (($condition1 |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | -if ( $condition1 |
|
| 67 | +if ($condition1 |
|
| 68 | 68 | || $condition2 |
| 69 | 69 | || $condition3 |
| 70 | 70 | ) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | if ($condition1 |
| 100 | 100 | || $condition2 || $condition3 |
| 101 | -){ |
|
| 101 | +) { |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ($condition1) |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | ) |
| 116 | 116 | echo 'bar'; |
| 117 | 117 | |
| 118 | -if (!empty($post) |
|
| 119 | - && (!empty($context['header']) |
|
| 118 | +if ( ! empty($post) |
|
| 119 | + && ( ! empty($context['header']) |
|
| 120 | 120 | xor stripos($context['header'], 'Content-Type')) |
| 121 | 121 | ) { |
| 122 | 122 | // ... |
@@ -101,19 +101,22 @@ discard block |
||
| 101 | 101 | ){ |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if ($condition1) |
|
| 104 | +if ($condition1) { |
|
| 105 | 105 | echo 'bar'; |
| 106 | +} |
|
| 106 | 107 | |
| 107 | 108 | if ($condition1 |
| 108 | 109 | || $condition2 |
| 109 | -|| $condition3) |
|
| 110 | +|| $condition3) { |
|
| 110 | 111 | echo 'bar'; |
| 112 | +} |
|
| 111 | 113 | |
| 112 | 114 | |
| 113 | 115 | if ($condition1 |
| 114 | 116 | || $condition2 || $condition3 |
| 115 | -) |
|
| 117 | +) { |
|
| 116 | 118 | echo 'bar'; |
| 119 | +} |
|
| 117 | 120 | |
| 118 | 121 | if (!empty($post) |
| 119 | 122 | && (!empty($context['header']) |
@@ -142,18 +145,22 @@ discard block |
||
| 142 | 145 | endif; |
| 143 | 146 | |
| 144 | 147 | if ($IPP->errorCode() == 401 || // comment |
| 145 | - $IPP->errorCode() == 3200) /* long comment |
|
| 148 | + $IPP->errorCode() == 3200) { |
|
| 149 | + /* long comment |
|
| 146 | 150 | here |
| 147 | 151 | */ |
| 148 | 152 | { |
| 149 | 153 | return false; |
| 150 | 154 | } |
| 155 | +} |
|
| 151 | 156 | |
| 152 | 157 | if ($IPP->errorCode() == 401 || // comment |
| 153 | - $IPP->errorCode() == 3200) // long comment here |
|
| 158 | + $IPP->errorCode() == 3200) { |
|
| 159 | + // long comment here |
|
| 154 | 160 | { |
| 155 | 161 | return false; |
| 156 | 162 | } |
| 163 | +} |
|
| 157 | 164 | |
| 158 | 165 | if ($IPP->errorCode() == 401 |
| 159 | 166 | // Comment explaining the next condition here. |
@@ -191,18 +198,22 @@ discard block |
||
| 191 | 198 | <?php |
| 192 | 199 | |
| 193 | 200 | if ($IPP->errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. |
| 194 | - $IPP->errorCode() == 3200) /* |
|
| 201 | + $IPP->errorCode() == 3200) { |
|
| 202 | + /* |
|
| 195 | 203 | phpcs:ignore Standard.Category.Sniff -- for reasons. |
| 196 | 204 | */ |
| 197 | 205 | { |
| 198 | 206 | return false; |
| 199 | 207 | } |
| 208 | +} |
|
| 200 | 209 | |
| 201 | 210 | if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. |
| 202 | - $IPP->errorCode() == 3200) // phpcs:enable |
|
| 211 | + $IPP->errorCode() == 3200) { |
|
| 212 | + // phpcs:enable |
|
| 203 | 213 | { |
| 204 | 214 | return false; |
| 205 | 215 | } |
| 216 | +} |
|
| 206 | 217 | |
| 207 | 218 | if ($IPP->errorCode() == 401 |
| 208 | 219 | // phpcs:ignore Standard.Category.Sniff -- for reasons. |
@@ -15,77 +15,77 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @param string $testFile The name of the file being tested. |
|
| 25 | - * |
|
| 26 | - * @return array<int, int> |
|
| 27 | - */ |
|
| 28 | - public function getErrorList($testFile='MultiLineConditionUnitTest.inc') |
|
| 29 | - { |
|
| 30 | - $errors = [ |
|
| 31 | - 21 => 1, |
|
| 32 | - 22 => 1, |
|
| 33 | - 35 => 1, |
|
| 34 | - 40 => 1, |
|
| 35 | - 41 => 1, |
|
| 36 | - 42 => 1, |
|
| 37 | - 43 => 1, |
|
| 38 | - 49 => 1, |
|
| 39 | - 54 => 1, |
|
| 40 | - 57 => 1, |
|
| 41 | - 58 => 1, |
|
| 42 | - 59 => 1, |
|
| 43 | - 61 => 1, |
|
| 44 | - 67 => 1, |
|
| 45 | - 87 => 1, |
|
| 46 | - 88 => 1, |
|
| 47 | - 89 => 1, |
|
| 48 | - 90 => 1, |
|
| 49 | - 96 => 2, |
|
| 50 | - 101 => 1, |
|
| 51 | - 109 => 2, |
|
| 52 | - 125 => 1, |
|
| 53 | - 145 => 2, |
|
| 54 | - 153 => 2, |
|
| 55 | - 168 => 1, |
|
| 56 | - 177 => 1, |
|
| 57 | - 194 => 2, |
|
| 58 | - 202 => 2, |
|
| 59 | - 215 => 1, |
|
| 60 | - 218 => 2, |
|
| 61 | - 232 => 2, |
|
| 62 | - 239 => 1, |
|
| 63 | - 240 => 2, |
|
| 64 | - 248 => 2, |
|
| 65 | - ]; |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @param string $testFile The name of the file being tested. |
|
| 25 | + * |
|
| 26 | + * @return array<int, int> |
|
| 27 | + */ |
|
| 28 | + public function getErrorList($testFile='MultiLineConditionUnitTest.inc') |
|
| 29 | + { |
|
| 30 | + $errors = [ |
|
| 31 | + 21 => 1, |
|
| 32 | + 22 => 1, |
|
| 33 | + 35 => 1, |
|
| 34 | + 40 => 1, |
|
| 35 | + 41 => 1, |
|
| 36 | + 42 => 1, |
|
| 37 | + 43 => 1, |
|
| 38 | + 49 => 1, |
|
| 39 | + 54 => 1, |
|
| 40 | + 57 => 1, |
|
| 41 | + 58 => 1, |
|
| 42 | + 59 => 1, |
|
| 43 | + 61 => 1, |
|
| 44 | + 67 => 1, |
|
| 45 | + 87 => 1, |
|
| 46 | + 88 => 1, |
|
| 47 | + 89 => 1, |
|
| 48 | + 90 => 1, |
|
| 49 | + 96 => 2, |
|
| 50 | + 101 => 1, |
|
| 51 | + 109 => 2, |
|
| 52 | + 125 => 1, |
|
| 53 | + 145 => 2, |
|
| 54 | + 153 => 2, |
|
| 55 | + 168 => 1, |
|
| 56 | + 177 => 1, |
|
| 57 | + 194 => 2, |
|
| 58 | + 202 => 2, |
|
| 59 | + 215 => 1, |
|
| 60 | + 218 => 2, |
|
| 61 | + 232 => 2, |
|
| 62 | + 239 => 1, |
|
| 63 | + 240 => 2, |
|
| 64 | + 248 => 2, |
|
| 65 | + ]; |
|
| 66 | 66 | |
| 67 | - if ($testFile === 'MultiLineConditionUnitTest.inc') { |
|
| 68 | - $errors[183] = 1; |
|
| 69 | - } |
|
| 67 | + if ($testFile === 'MultiLineConditionUnitTest.inc') { |
|
| 68 | + $errors[183] = 1; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - return $errors; |
|
| 71 | + return $errors; |
|
| 72 | 72 | |
| 73 | - }//end getErrorList() |
|
| 73 | + }//end getErrorList() |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Returns the lines where warnings should occur. |
|
| 78 | - * |
|
| 79 | - * The key of the array should represent the line number and the value |
|
| 80 | - * should represent the number of warnings that should occur on that line. |
|
| 81 | - * |
|
| 82 | - * @return array<int, int> |
|
| 83 | - */ |
|
| 84 | - public function getWarningList() |
|
| 85 | - { |
|
| 86 | - return []; |
|
| 76 | + /** |
|
| 77 | + * Returns the lines where warnings should occur. |
|
| 78 | + * |
|
| 79 | + * The key of the array should represent the line number and the value |
|
| 80 | + * should represent the number of warnings that should occur on that line. |
|
| 81 | + * |
|
| 82 | + * @return array<int, int> |
|
| 83 | + */ |
|
| 84 | + public function getWarningList() |
|
| 85 | + { |
|
| 86 | + return []; |
|
| 87 | 87 | |
| 88 | - }//end getWarningList() |
|
| 88 | + }//end getWarningList() |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | }//end class |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return array<int, int> |
| 27 | 27 | */ |
| 28 | - public function getErrorList($testFile='MultiLineConditionUnitTest.inc') |
|
| 28 | + public function getErrorList($testFile = 'MultiLineConditionUnitTest.inc') |
|
| 29 | 29 | { |
| 30 | 30 | $errors = [ |
| 31 | 31 | 21 => 1, |