| @@ 81-90 (lines=10) @@ | ||
| 78 | } |
|
| 79 | ||
| 80 | // The first line of the comment should just be the /** code. |
|
| 81 | if ($tokens[$short]['line'] === $tokens[$stackPtr]['line']) { |
|
| 82 | $error = 'The open comment tag must be the only content on the line'; |
|
| 83 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); |
|
| 84 | if ($fix === true) { |
|
| 85 | $phpcsFile->fixer->beginChangeset(); |
|
| 86 | $phpcsFile->fixer->addNewline($stackPtr); |
|
| 87 | $phpcsFile->fixer->addContentBefore($short, '* '); |
|
| 88 | $phpcsFile->fixer->endChangeset(); |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ||
| 92 | // The last line of the comment should just be the */ code. |
|
| 93 | $prev = $phpcsFile->findPrevious($empty, ($commentEnd - 1), $stackPtr, true); |
|
| @@ 240-253 (lines=14) @@ | ||
| 237 | if ($valueCount > 0) { |
|
| 238 | $conditionCheck = $phpcsFile->findPrevious(array(T_OPEN_PARENTHESIS, T_SEMICOLON), ($stackPtr - 1), null, false); |
|
| 239 | ||
| 240 | if ($conditionCheck === false |
|
| 241 | || $tokens[$conditionCheck]['line'] !== $tokens[$stackPtr]['line'] |
|
| 242 | ) { |
|
| 243 | $error = 'Array with multiple values cannot be declared on a single line'; |
|
| 244 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLineNotAllowed'); |
|
| 245 | if ($fix === true) { |
|
| 246 | $phpcsFile->fixer->beginChangeset(); |
|
| 247 | $phpcsFile->fixer->addNewline($arrayStart); |
|
| 248 | $phpcsFile->fixer->addNewlineBefore($arrayEnd); |
|
| 249 | $phpcsFile->fixer->endChangeset(); |
|
| 250 | } |
|
| 251 | ||
| 252 | return; |
|
| 253 | } |
|
| 254 | ||
| 255 | // We have a multiple value array that is inside a condition or |
|
| 256 | // function. Check its spacing is correct. |
|