@@ -29,14 +29,14 @@ abstract class AbstractSniff implements Sniff
2929 ];
3030
3131 /**
32- * @param \PHP_CodeSniffer\Files\File $phpCsFile
32+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
3333 * @param int $stackPtr
3434 *
3535 * @return bool
3636 */
37- protected function isPhpStormMarker (File $ phpCsFile , int $ stackPtr ): bool
37+ protected function isPhpStormMarker (File $ phpcsFile , int $ stackPtr ): bool
3838 {
39- $ tokens = $ phpCsFile ->getTokens ();
39+ $ tokens = $ phpcsFile ->getTokens ();
4040 $ line = $ tokens [$ stackPtr ]['line ' ];
4141 if ($ tokens [$ stackPtr ]['type ' ] !== 'T_DOC_COMMENT_OPEN_TAG ' ) {
4242 return false ;
@@ -46,7 +46,7 @@ protected function isPhpStormMarker(File $phpCsFile, int $stackPtr): bool
4646 return false ; // Not an inline comment
4747 }
4848 foreach (static ::$ phpStormMarkers as $ marker ) {
49- if ($ phpCsFile ->findNext (T_DOC_COMMENT_TAG , $ stackPtr + 1 , $ end , false , $ marker ) !== false ) {
49+ if ($ phpcsFile ->findNext (T_DOC_COMMENT_TAG , $ stackPtr + 1 , $ end , false , $ marker ) !== false ) {
5050 return true ;
5151 }
5252 }
@@ -79,60 +79,60 @@ protected function getIndentationLevel(File $phpcsFile, int $index): int
7979 }
8080
8181 /**
82- * @param \PHP_CodeSniffer\Files\File $phpCsFile
82+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
8383 *
8484 * @return string
8585 */
86- protected function getNamespace (File $ phpCsFile ): string
86+ protected function getNamespace (File $ phpcsFile ): string
8787 {
88- $ className = $ this ->getClassName ($ phpCsFile );
88+ $ className = $ this ->getClassName ($ phpcsFile );
8989 $ classNameParts = explode ('\\' , $ className );
9090
9191 return $ classNameParts [0 ];
9292 }
9393
9494 /**
95- * @param \PHP_CodeSniffer\Files\File $phpCsFile
95+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
9696 *
9797 * @return string|null
9898 */
99- protected function getClassNameWithNamespace (File $ phpCsFile ): ?string
99+ protected function getClassNameWithNamespace (File $ phpcsFile ): ?string
100100 {
101101 try {
102- $ lastToken = TokenHelper::getLastTokenPointer ($ phpCsFile );
102+ $ lastToken = TokenHelper::getLastTokenPointer ($ phpcsFile );
103103 } catch (EmptyFileException $ e ) {
104104 return null ;
105105 }
106106
107- if (!NamespaceHelper::findCurrentNamespaceName ($ phpCsFile , $ lastToken )) {
107+ if (!NamespaceHelper::findCurrentNamespaceName ($ phpcsFile , $ lastToken )) {
108108 return null ;
109109 }
110110
111- $ prevIndex = $ phpCsFile ->findPrevious ([T_CLASS , T_TRAIT , T_INTERFACE , T_ENUM ], $ lastToken );
111+ $ prevIndex = $ phpcsFile ->findPrevious ([T_CLASS , T_TRAIT , T_INTERFACE , T_ENUM ], $ lastToken );
112112 if (!$ prevIndex ) {
113113 return null ;
114114 }
115115
116116 return ClassHelper::getFullyQualifiedName (
117- $ phpCsFile ,
117+ $ phpcsFile ,
118118 $ prevIndex ,
119119 );
120120 }
121121
122122 /**
123- * @param \PHP_CodeSniffer\Files\File $phpCsFile
123+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
124124 *
125125 * @return string
126126 */
127- protected function getClassName (File $ phpCsFile ): string
127+ protected function getClassName (File $ phpcsFile ): string
128128 {
129- $ namespace = $ this ->getClassNameWithNamespace ($ phpCsFile );
129+ $ namespace = $ this ->getClassNameWithNamespace ($ phpcsFile );
130130
131131 if ($ namespace ) {
132132 return trim ($ namespace , '\\' );
133133 }
134134
135- $ fileName = $ phpCsFile ->getFilename ();
135+ $ fileName = $ phpcsFile ->getFilename ();
136136 $ fileNameParts = explode (DIRECTORY_SEPARATOR , $ fileName );
137137 $ directoryPosition = array_search ('src ' , $ fileNameParts , true );
138138 if (!$ directoryPosition ) {
@@ -229,18 +229,18 @@ protected function needsBrackets(File $phpcsFile, int $openingBraceIndex, int $c
229229 }
230230
231231 /**
232- * @param \PHP_CodeSniffer\Files\File $phpCsFile
232+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
233233 * @param int $stackPointer
234234 *
235235 * @return int|null Stackpointer value of docblock end tag, or null if cannot be found
236236 */
237- protected function findRelatedDocBlock (File $ phpCsFile , int $ stackPointer ): ?int
237+ protected function findRelatedDocBlock (File $ phpcsFile , int $ stackPointer ): ?int
238238 {
239- $ tokens = $ phpCsFile ->getTokens ();
239+ $ tokens = $ phpcsFile ->getTokens ();
240240
241241 $ beginningOfLine = $ this ->getFirstTokenOfLine ($ tokens , $ stackPointer );
242242
243- $ prevContentIndex = $ phpCsFile ->findPrevious (T_WHITESPACE , $ beginningOfLine - 1 , null , true );
243+ $ prevContentIndex = $ phpcsFile ->findPrevious (T_WHITESPACE , $ beginningOfLine - 1 , null , true );
244244 if (!$ prevContentIndex ) {
245245 return null ;
246246 }
@@ -390,13 +390,13 @@ protected function getLastTokenOfLine(array $tokens, int $index): int
390390 }
391391
392392 /**
393- * @param \PHP_CodeSniffer\Files\File $phpCsFile
393+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
394394 * @param array<int, array<string, mixed>> $tokens
395395 * @param int $stackPointer
396396 *
397397 * @return bool
398398 */
399- protected function isMarkedAsDeprecated (File $ phpCsFile , array $ tokens , int $ stackPointer ): bool
399+ protected function isMarkedAsDeprecated (File $ phpcsFile , array $ tokens , int $ stackPointer ): bool
400400 {
401401 $ begin = $ tokens [$ stackPointer ]['scope_opener ' ] + 1 ;
402402 $ end = $ tokens [$ stackPointer ]['scope_closer ' ] - 1 ;
@@ -409,23 +409,23 @@ protected function isMarkedAsDeprecated(File $phpCsFile, array $tokens, int $sta
409409 }
410410 }
411411
412- if ($ this ->isMarkedDeprecatedInDocBlock ($ phpCsFile , $ tokens , $ stackPointer )) {
412+ if ($ this ->isMarkedDeprecatedInDocBlock ($ phpcsFile , $ tokens , $ stackPointer )) {
413413 return true ;
414414 }
415415
416416 return false ;
417417 }
418418
419419 /**
420- * @param \PHP_CodeSniffer\Files\File $phpCsFile
420+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
421421 * @param array<int, array<string, mixed>> $tokens
422422 * @param int $stackPointer
423423 *
424424 * @return bool
425425 */
426- protected function isMarkedDeprecatedInDocBlock (File $ phpCsFile , array $ tokens , int $ stackPointer ): bool
426+ protected function isMarkedDeprecatedInDocBlock (File $ phpcsFile , array $ tokens , int $ stackPointer ): bool
427427 {
428- $ docBlockEndIndex = $ this ->findRelatedDocBlock ($ phpCsFile , $ stackPointer );
428+ $ docBlockEndIndex = $ this ->findRelatedDocBlock ($ phpcsFile , $ stackPointer );
429429 if (!$ docBlockEndIndex ) {
430430 return false ;
431431 }
@@ -445,14 +445,14 @@ protected function isMarkedDeprecatedInDocBlock(File $phpCsFile, array $tokens,
445445 }
446446
447447 /**
448- * @param \PHP_CodeSniffer\Files\File $phpCsFile
448+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
449449 * @param int $stackPointer
450450 *
451451 * @return array<string>
452452 */
453- protected function getDocBlockReturnTypes (File $ phpCsFile , int $ stackPointer ): array
453+ protected function getDocBlockReturnTypes (File $ phpcsFile , int $ stackPointer ): array
454454 {
455- $ docBlock = DocCommentHelper::getDocComment ($ phpCsFile , $ stackPointer );
455+ $ docBlock = DocCommentHelper::getDocComment ($ phpcsFile , $ stackPointer );
456456
457457 if ($ docBlock === null ) {
458458 return [];
@@ -472,38 +472,38 @@ protected function getDocBlockReturnTypes(File $phpCsFile, int $stackPointer): a
472472 }
473473
474474 /**
475- * @param \PHP_CodeSniffer\Files\File $phpCsFile
475+ * @param \PHP_CodeSniffer\Files\File $phpcsFile
476476 * @param int $fileDocBlockStartPosition
477477 *
478478 * @return void
479479 */
480- protected function assertNewlineBefore (File $ phpCsFile , int $ fileDocBlockStartPosition ): void
480+ protected function assertNewlineBefore (File $ phpcsFile , int $ fileDocBlockStartPosition ): void
481481 {
482- $ tokens = $ phpCsFile ->getTokens ();
482+ $ tokens = $ phpcsFile ->getTokens ();
483483
484- $ prevIndex = $ phpCsFile ->findPrevious (T_WHITESPACE , $ fileDocBlockStartPosition - 1 , 0 , true );
484+ $ prevIndex = $ phpcsFile ->findPrevious (T_WHITESPACE , $ fileDocBlockStartPosition - 1 , 0 , true );
485485 if ($ prevIndex === false || $ tokens [$ prevIndex ]['line ' ] === $ tokens [$ fileDocBlockStartPosition ]['line ' ] - 2 ) {
486486 return ;
487487 }
488488
489- $ fix = $ phpCsFile ->addFixableError ('Whitespace issue around file doc block ' , $ fileDocBlockStartPosition , 'FileDocBlockSpacing ' );
489+ $ fix = $ phpcsFile ->addFixableError ('Whitespace issue around file doc block ' , $ fileDocBlockStartPosition , 'FileDocBlockSpacing ' );
490490 if (!$ fix ) {
491491 return ;
492492 }
493493
494- $ phpCsFile ->fixer ->beginChangeset ();
494+ $ phpcsFile ->fixer ->beginChangeset ();
495495
496496 if ($ tokens [$ prevIndex ]['line ' ] > $ tokens [$ fileDocBlockStartPosition ]['line ' ] - 2 ) {
497- $ phpCsFile ->fixer ->addNewline ($ prevIndex );
497+ $ phpcsFile ->fixer ->addNewline ($ prevIndex );
498498 } else {
499499 $ index = $ prevIndex ;
500500 while ($ index < $ fileDocBlockStartPosition - 1 ) {
501501 $ index ++;
502- $ phpCsFile ->fixer ->replaceToken ($ index , '' );
502+ $ phpcsFile ->fixer ->replaceToken ($ index , '' );
503503 }
504504 }
505505
506- $ phpCsFile ->fixer ->endChangeset ();
506+ $ phpcsFile ->fixer ->endChangeset ();
507507 }
508508
509509 /**
0 commit comments