@@ 152-171 (lines=20) @@ | ||
149 | * |
|
150 | * @return void |
|
151 | */ |
|
152 | private function checkCommentDescriptionUcFirst($descriptionStartPtr) |
|
153 | { |
|
154 | $descStartToken = $this->tokens[$descriptionStartPtr]; |
|
155 | ||
156 | $descriptionContent = $descStartToken['content']; |
|
157 | ||
158 | if (ucfirst($descriptionContent) === $descriptionContent) { |
|
159 | return; |
|
160 | } |
|
161 | ||
162 | $fixUcFirst = $this->file->addFixableError( |
|
163 | AbstractDocSniff::MESSAGE_DESCRIPTION_UC_FIRST, |
|
164 | $descriptionStartPtr, |
|
165 | AbstractDocSniff::CODE_DESCRIPTION_UC_FIRST |
|
166 | ); |
|
167 | ||
168 | if ($fixUcFirst) { |
|
169 | $this->fixDescriptionUcFirst($descriptionStartPtr); |
|
170 | } |
|
171 | } |
|
172 | ||
173 | /** |
|
174 | * Checks the line length of each line of the comment description. |
@@ 234-251 (lines=18) @@ | ||
231 | * |
|
232 | * @return void |
|
233 | */ |
|
234 | private function checkCommentTagStringSpacing($tagStringPtr) |
|
235 | { |
|
236 | $tagStringToken = $this->tokens[$tagStringPtr]; |
|
237 | ||
238 | $tagStringContent = $tagStringToken['content']; |
|
239 | ||
240 | if (preg_replace('/\s\s+/', ' ', $tagStringContent) !== $tagStringContent) { |
|
241 | $fixStringAlignment = $this->phpcsFile->addFixableError( |
|
242 | self::MESSAGE_WRONG_COMMENT_TAG_SPACING, |
|
243 | $tagStringPtr, |
|
244 | self::CODE_WRONG_COMMENT_TAG_SPACING |
|
245 | ); |
|
246 | ||
247 | if ($fixStringAlignment) { |
|
248 | $this->fixCommentTagStringSpacing($tagStringPtr); |
|
249 | } |
|
250 | } |
|
251 | } |
|
252 | ||
253 | /** |
|
254 | * Fixes comment tag string spacing. |