@@ 154-159 (lines=6) @@ | ||
151 | // They must (at least) have a comment describing why |
|
152 | // the default case is being ignored. |
|
153 | $foundContent = FALSE; |
|
154 | for ($i = ($this->tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { |
|
155 | if ($this->tokens[$i]['type'] !== 'T_WHITESPACE') { |
|
156 | $foundContent = TRUE; |
|
157 | break; |
|
158 | } |
|
159 | } |
|
160 | if ($foundContent === FALSE) { |
|
161 | $error = 'Comment required for empty DEFAULT case'; |
|
162 | $this->file->addError($error, $nextCase, 'EmptyDefault'); |
|
@@ 232-237 (lines=6) @@ | ||
229 | { |
|
230 | $caseLine = $this->tokens[$nextCase]['line']; |
|
231 | $nextLine = $this->tokens[$nextBreak]['line']; |
|
232 | for ($i = ($opener + 1); $i < $nextBreak; $i++) { |
|
233 | if ($this->tokens[$i]['type'] !== 'T_WHITESPACE') { |
|
234 | $nextLine = $this->tokens[$i]['line']; |
|
235 | break; |
|
236 | } |
|
237 | } |
|
238 | if ($nextLine !== ($caseLine + 1)) { |
|
239 | $error = 'Blank lines are not allowed after ' . strtoupper($type) . ' statements'; |
|
240 | $this->file->addError($error, $nextCase, 'SpacingAfter' . $type); |