@@ 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. |
@@ 212-229 (lines=18) @@ | ||
209 | * |
|
210 | * @return void |
|
211 | */ |
|
212 | private function checkCommentTagStringSpacing($tagStringPtr) |
|
213 | { |
|
214 | $tagStringToken = $this->tokens[$tagStringPtr]; |
|
215 | ||
216 | $tagStringContent = $tagStringToken['content']; |
|
217 | ||
218 | if (preg_replace('/\s\s+/', ' ', $tagStringContent) !== $tagStringContent) { |
|
219 | $fixStringAlignment = $this->phpcsFile->addFixableError( |
|
220 | self::MESSAGE_WRONG_COMMENT_TAG_SPACING, |
|
221 | $tagStringPtr, |
|
222 | self::CODE_WRONG_COMMENT_TAG_SPACING |
|
223 | ); |
|
224 | ||
225 | if ($fixStringAlignment) { |
|
226 | $this->fixCommentTagStringSpacing($tagStringPtr); |
|
227 | } |
|
228 | } |
|
229 | } |
|
230 | ||
231 | /** |
|
232 | * Fixes comment tag string spacing. |