@@ -139,6 +139,7 @@ private function fix(File $file, array $namesWithValues): void
139139 private function findConstantNamesWithValuesByVisibility (File $ phpcsFile ): array
140140 {
141141 $ constantNamesWithValues = [];
142+ /** @var array<int, array{code: int|string, content: string}> $tokens */
142143 $ tokens = $ phpcsFile ->getTokens ();
143144
144145 foreach ($ tokens as $ stackPtr => $ token ) {
@@ -177,6 +178,7 @@ private function findConstantNamesWithValuesByVisibility(File $phpcsFile): array
177178
178179 private function getVisibility (File $ phpcsFile , int $ constStackPtr ): string
179180 {
181+ /** @var array<int, array{code: int|string, content: string}> $tokens */
180182 $ tokens = $ phpcsFile ->getTokens ();
181183 $ visibilityTokenPointer = $ phpcsFile ->findPrevious (
182184 types: Tokens::$ emptyTokens ,
@@ -186,13 +188,14 @@ private function getVisibility(File $phpcsFile, int $constStackPtr): string
186188 );
187189
188190 return in_array ($ tokens [$ visibilityTokenPointer ]['code ' ], [T_PUBLIC , T_PROTECTED , T_PRIVATE ], true )
189- ? ( string ) $ tokens [$ visibilityTokenPointer ]['content ' ]
191+ ? $ tokens [$ visibilityTokenPointer ]['content ' ]
190192 : 'public ' ;
191193 }
192194
193195 /** @phpstan-return TypeNameShape|null */
194196 private function findTypeAndConstantName (File $ phpcsFile , int $ constStackPtr ): array |null
195197 {
198+ /** @var array<int, array{code: int|string, content: string}> $tokens */
196199 $ tokens = $ phpcsFile ->getTokens ();
197200 $ assignmentOperatorTokenPtr = $ phpcsFile ->findNext (
198201 types: [T_EQUAL , T_SEMICOLON ],
@@ -241,6 +244,7 @@ private function findTypeAndConstantName(File $phpcsFile, int $constStackPtr): a
241244
242245 private function findEqualsPointer (File $ phpcsFile , int $ constNameStackPtr ): int |null
243246 {
247+ /** @var array<int, array{code: int|string, content: string}> $tokens */
244248 $ tokens = $ phpcsFile ->getTokens ();
245249 $ equalsTokenPointer = $ phpcsFile ->findNext (
246250 types: Tokens::$ emptyTokens ,
@@ -259,6 +263,7 @@ private function findEqualsPointer(File $phpcsFile, int $constNameStackPtr): int
259263 /** @phpstan-return ValueShape|null */
260264 private function findValue (File $ phpcsFile , int $ equalsTokenPointer ): array |null
261265 {
266+ /** @var array<int, array{code: int|string, content: string}> $tokens */
262267 $ tokens = $ phpcsFile ->getTokens ();
263268 $ startValueTokenPointer = $ phpcsFile ->findNext (
264269 types: Tokens::$ emptyTokens ,
0 commit comments