| @@ 922-927 (lines=6) @@ | ||
| 919 | echo "Open PHP tag found on line $line".PHP_EOL; |
|
| 920 | } |
|
| 921 | ||
| 922 | if ($checkToken === null) { |
|
| 923 | $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $i, true); |
|
| 924 | $currentIndent = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); |
|
| 925 | } else { |
|
| 926 | $currentIndent = ($tokens[$i]['column'] - 1); |
|
| 927 | } |
|
| 928 | ||
| 929 | $lastOpenTag = $i; |
|
| 930 | ||
| @@ 159-164 (lines=6) @@ | ||
| 156 | }//end if |
|
| 157 | ||
| 158 | $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); |
|
| 159 | if ($first === false) { |
|
| 160 | $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); |
|
| 161 | $indent = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); |
|
| 162 | } else { |
|
| 163 | $indent = ($tokens[($first + 1)]['column'] - 1); |
|
| 164 | } |
|
| 165 | ||
| 166 | $contentColumn = ($tokens[$firstContent]['column'] - 1); |
|
| 167 | if ($contentColumn !== $indent) { |
|
| @@ 194-199 (lines=6) @@ | ||
| 191 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeOpen'); |
|
| 192 | if ($fix === true) { |
|
| 193 | $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); |
|
| 194 | if ($first === false) { |
|
| 195 | $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); |
|
| 196 | $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); |
|
| 197 | } else { |
|
| 198 | $padding = ($tokens[($first + 1)]['column'] - 1); |
|
| 199 | } |
|
| 200 | ||
| 201 | $phpcsFile->fixer->addContentBefore($stackPtr, $phpcsFile->eolChar.str_repeat(' ', $padding)); |
|
| 202 | } |
|