| @@ 145-160 (lines=16) @@ | ||
| 142 | continue; |
|
| 143 | } |
|
| 144 | ||
| 145 | if ($tokens[($i + 1)]['code'] !== T_DOC_COMMENT_WHITESPACE) { |
|
| 146 | $error = 'Expected 1 space after asterisk; 0 found'; |
|
| 147 | $fix = $phpcsFile->addFixableError($error, $i, 'NoSpaceAfterStar'); |
|
| 148 | if ($fix === true) { |
|
| 149 | $phpcsFile->fixer->addContent($i, ' '); |
|
| 150 | } |
|
| 151 | } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG |
|
| 152 | && $tokens[($i + 1)]['content'] !== ' ' |
|
| 153 | ) { |
|
| 154 | $error = 'Expected 1 space after asterisk; %s found'; |
|
| 155 | $data = array(strlen($tokens[($i + 1)]['content'])); |
|
| 156 | $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data); |
|
| 157 | if ($fix === true) { |
|
| 158 | $phpcsFile->fixer->replaceToken(($i + 1), ' '); |
|
| 159 | } |
|
| 160 | } |
|
| 161 | }//end for |
|
| 162 | ||
| 163 | }//end process() |
|
| @@ 166-184 (lines=19) @@ | ||
| 163 | } |
|
| 164 | } |
|
| 165 | ||
| 166 | if ($tokens[($firstSemicolon + 1)]['code'] !== T_WHITESPACE |
|
| 167 | && $tokens[($firstSemicolon + 1)]['code'] !== T_SEMICOLON |
|
| 168 | ) { |
|
| 169 | $error = 'Expected 1 space after first semicolon of FOR loop; 0 found'; |
|
| 170 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterFirst'); |
|
| 171 | if ($fix === true) { |
|
| 172 | $phpcsFile->fixer->addContent($firstSemicolon, ' '); |
|
| 173 | } |
|
| 174 | } else { |
|
| 175 | if (strlen($tokens[($firstSemicolon + 1)]['content']) !== 1) { |
|
| 176 | $spaces = strlen($tokens[($firstSemicolon + 1)]['content']); |
|
| 177 | $error = 'Expected 1 space after first semicolon of FOR loop; %s found'; |
|
| 178 | $data = array($spaces); |
|
| 179 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterFirst', $data); |
|
| 180 | if ($fix === true) { |
|
| 181 | $phpcsFile->fixer->replaceToken(($firstSemicolon + 1), ' '); |
|
| 182 | } |
|
| 183 | } |
|
| 184 | } |
|
| 185 | ||
| 186 | $secondSemicolon = $phpcsFile->findNext(T_SEMICOLON, ($firstSemicolon + 1)); |
|
| 187 | ||