@@ 204-220 (lines=17) @@ | ||
201 | } |
|
202 | ||
203 | // No extra newline before short description. |
|
204 | if ($tokens[$short]['line'] !== ($tokens[$stackPtr]['line'] + 1)) { |
|
205 | $error = self::MESSAGE_CODE_SPACING_BEFORE; |
|
206 | $fix = $phpcsFile->addFixableError($error, $short, self::CODE_SPACING_BEFORE_SHORT); |
|
207 | if ($fix) { |
|
208 | $phpcsFile->fixer->beginChangeset(); |
|
209 | for ($i = $stackPtr; $i < $short; $i++) { |
|
210 | if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { |
|
211 | continue; |
|
212 | } |
|
213 | if ($tokens[$i]['line'] === $tokens[$short]['line']) { |
|
214 | break; |
|
215 | } |
|
216 | $phpcsFile->fixer->replaceToken($i, ''); |
|
217 | } |
|
218 | $phpcsFile->fixer->endChangeset(); |
|
219 | } |
|
220 | } |
|
221 | ||
222 | $shortContent = $tokens[$short]['content']; |
|
223 | $shortEnd = $short; |
|
@@ 240-258 (lines=19) @@ | ||
237 | ||
238 | $long = $phpcsFile->findNext($empty, $shortEnd + 1, $commentEnd - 1, true); |
|
239 | if ($long !== false && $tokens[$long]['code'] === T_DOC_COMMENT_STRING) { |
|
240 | if ($tokens[$long]['line'] !== ($tokens[$shortEnd]['line'] + 2)) { |
|
241 | $error = self::MESSAGE_SPACING_BETWEEN; |
|
242 | $fix = $phpcsFile->addFixableError($error, $long, self::CODE_SPACING_BETWEEN); |
|
243 | if ($fix) { |
|
244 | $phpcsFile->fixer->beginChangeset(); |
|
245 | for ($i = ($shortEnd + 1); $i < $long; $i++) { |
|
246 | if ($tokens[$i]['line'] === $tokens[$shortEnd]['line']) { |
|
247 | continue; |
|
248 | } |
|
249 | if ($tokens[$i]['line'] === ($tokens[$long]['line'] - 1)) { |
|
250 | break; |
|
251 | } |
|
252 | ||
253 | $phpcsFile->fixer->replaceToken($i, ''); |
|
254 | } |
|
255 | ||
256 | $phpcsFile->fixer->endChangeset(); |
|
257 | } |
|
258 | } |
|
259 | ||
260 | if (preg_match('/^\p{Ll}/u', $tokens[$long]['content']) === 1) { |
|
261 | $error = self::MESSAGE_LONG_NOT_CAPITAL; |