| @@ 327-345 (lines=19) @@ | ||
| 324 | if ($fix === true) { |
|
| 325 | $phpcsFile->fixer->addNewlineBefore($arrayEnd); |
|
| 326 | } |
|
| 327 | } else if ($tokens[$arrayEnd]['column'] !== $keywordStart) { |
|
| 328 | // Check the closing bracket is lined up under the "a" in array. |
|
| 329 | $expected = ($keywordStart - 1); |
|
| 330 | $found = ($tokens[$arrayEnd]['column'] - 1); |
|
| 331 | $error = 'Closing parenthesis not aligned correctly; expected %s space(s) but found %s'; |
|
| 332 | $data = array( |
|
| 333 | $expected, |
|
| 334 | $found, |
|
| 335 | ); |
|
| 336 | ||
| 337 | $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotAligned', $data); |
|
| 338 | if ($fix === true) { |
|
| 339 | if ($found === 0) { |
|
| 340 | $phpcsFile->fixer->addContent(($arrayEnd - 1), str_repeat(' ', $expected)); |
|
| 341 | } else { |
|
| 342 | $phpcsFile->fixer->replaceToken(($arrayEnd - 1), str_repeat(' ', $expected)); |
|
| 343 | } |
|
| 344 | } |
|
| 345 | }//end if |
|
| 346 | ||
| 347 | $keyUsed = false; |
|
| 348 | $singleUsed = false; |
|
| @@ 119-134 (lines=16) @@ | ||
| 116 | } |
|
| 117 | } |
|
| 118 | ||
| 119 | if ($tokens[$i]['column'] !== $requiredColumn) { |
|
| 120 | $error = 'Expected %s space(s) before asterisk; %s found'; |
|
| 121 | $data = array( |
|
| 122 | ($requiredColumn - 1), |
|
| 123 | ($tokens[$i]['column'] - 1), |
|
| 124 | ); |
|
| 125 | $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data); |
|
| 126 | if ($fix === true) { |
|
| 127 | $padding = str_repeat(' ', ($requiredColumn - 1)); |
|
| 128 | if ($tokens[$i]['column'] === 1) { |
|
| 129 | $phpcsFile->fixer->addContentBefore($i, $padding); |
|
| 130 | } else { |
|
| 131 | $phpcsFile->fixer->replaceToken(($i - 1), $padding); |
|
| 132 | } |
|
| 133 | } |
|
| 134 | } |
|
| 135 | ||
| 136 | if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) { |
|
| 137 | continue; |
|