|
@@ 248-254 (lines=7) @@
|
| 245 |
|
if ($tokens[$lastContent]['line'] === $tokens[$closingTag]['line']) { |
| 246 |
|
$error = 'Closing PHP tag must be on a line by itself'; |
| 247 |
|
$fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentBeforeEnd'); |
| 248 |
|
if ($fix === true) { |
| 249 |
|
$first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); |
| 250 |
|
$phpcsFile->fixer->beginChangeset(); |
| 251 |
|
$phpcsFile->fixer->addContentBefore($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1))); |
| 252 |
|
$phpcsFile->fixer->addNewlineBefore($closingTag); |
| 253 |
|
$phpcsFile->fixer->endChangeset(); |
| 254 |
|
} |
| 255 |
|
} else if ($tokens[$nextContent]['line'] === $tokens[$closingTag]['line']) { |
| 256 |
|
$error = 'Closing PHP tag must be on a line by itself'; |
| 257 |
|
$fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentAfterEnd'); |
|
@@ 258-264 (lines=7) @@
|
| 255 |
|
} else if ($tokens[$nextContent]['line'] === $tokens[$closingTag]['line']) { |
| 256 |
|
$error = 'Closing PHP tag must be on a line by itself'; |
| 257 |
|
$fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentAfterEnd'); |
| 258 |
|
if ($fix === true) { |
| 259 |
|
$first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); |
| 260 |
|
$phpcsFile->fixer->beginChangeset(); |
| 261 |
|
$phpcsFile->fixer->addNewline($closingTag); |
| 262 |
|
$phpcsFile->fixer->addContent($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1))); |
| 263 |
|
$phpcsFile->fixer->endChangeset(); |
| 264 |
|
} |
| 265 |
|
}//end if |
| 266 |
|
|
| 267 |
|
$next = $phpcsFile->findNext(T_OPEN_TAG, ($closingTag + 1)); |