| @@ 159-166 (lines=8) @@ | ||
| 156 | } |
|
| 157 | ||
| 158 | // Special case for JS files. |
|
| 159 | if ($tokens[$previousContent]['code'] === T_COMMA |
|
| 160 | || $tokens[$previousContent]['code'] === T_SEMICOLON |
|
| 161 | ) { |
|
| 162 | $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($previousContent - 1), null, true); |
|
| 163 | if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { |
|
| 164 | return; |
|
| 165 | } |
|
| 166 | } |
|
| 167 | } |
|
| 168 | ||
| 169 | $comment = rtrim($tokens[$stackPtr]['content']); |
|
| @@ 85-92 (lines=8) @@ | ||
| 82 | } |
|
| 83 | ||
| 84 | // Special case for JS files. |
|
| 85 | if ($tokens[$lastContent]['code'] === T_COMMA |
|
| 86 | || $tokens[$lastContent]['code'] === T_SEMICOLON |
|
| 87 | ) { |
|
| 88 | $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($lastContent - 1), null, true); |
|
| 89 | if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { |
|
| 90 | return; |
|
| 91 | } |
|
| 92 | } |
|
| 93 | ||
| 94 | $error = 'Comments may not appear after statements'; |
|
| 95 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); |
|