@@ -139,6 +139,7 @@ private function fix(File $file, array $namesWithValues): void
139
139
private function findConstantNamesWithValuesByVisibility (File $ phpcsFile ): array
140
140
{
141
141
$ constantNamesWithValues = [];
142
+ /** @var array<int, array{code: int|string, content: string}> $tokens */
142
143
$ tokens = $ phpcsFile ->getTokens ();
143
144
144
145
foreach ($ tokens as $ stackPtr => $ token ) {
@@ -177,6 +178,7 @@ private function findConstantNamesWithValuesByVisibility(File $phpcsFile): array
177
178
178
179
private function getVisibility (File $ phpcsFile , int $ constStackPtr ): string
179
180
{
181
+ /** @var array<int, array{code: int|string, content: string}> $tokens */
180
182
$ tokens = $ phpcsFile ->getTokens ();
181
183
$ visibilityTokenPointer = $ phpcsFile ->findPrevious (
182
184
types: Tokens::$ emptyTokens ,
@@ -186,13 +188,14 @@ private function getVisibility(File $phpcsFile, int $constStackPtr): string
186
188
);
187
189
188
190
return in_array ($ tokens [$ visibilityTokenPointer ]['code ' ], [T_PUBLIC , T_PROTECTED , T_PRIVATE ], true )
189
- ? ( string ) $ tokens [$ visibilityTokenPointer ]['content ' ]
191
+ ? $ tokens [$ visibilityTokenPointer ]['content ' ]
190
192
: 'public ' ;
191
193
}
192
194
193
195
/** @phpstan-return TypeNameShape|null */
194
196
private function findTypeAndConstantName (File $ phpcsFile , int $ constStackPtr ): array |null
195
197
{
198
+ /** @var array<int, array{code: int|string, content: string}> $tokens */
196
199
$ tokens = $ phpcsFile ->getTokens ();
197
200
$ assignmentOperatorTokenPtr = $ phpcsFile ->findNext (
198
201
types: [T_EQUAL , T_SEMICOLON ],
@@ -241,6 +244,7 @@ private function findTypeAndConstantName(File $phpcsFile, int $constStackPtr): a
241
244
242
245
private function findEqualsPointer (File $ phpcsFile , int $ constNameStackPtr ): int |null
243
246
{
247
+ /** @var array<int, array{code: int|string, content: string}> $tokens */
244
248
$ tokens = $ phpcsFile ->getTokens ();
245
249
$ equalsTokenPointer = $ phpcsFile ->findNext (
246
250
types: Tokens::$ emptyTokens ,
@@ -259,6 +263,7 @@ private function findEqualsPointer(File $phpcsFile, int $constNameStackPtr): int
259
263
/** @phpstan-return ValueShape|null */
260
264
private function findValue (File $ phpcsFile , int $ equalsTokenPointer ): array |null
261
265
{
266
+ /** @var array<int, array{code: int|string, content: string}> $tokens */
262
267
$ tokens = $ phpcsFile ->getTokens ();
263
268
$ startValueTokenPointer = $ phpcsFile ->findNext (
264
269
types: Tokens::$ emptyTokens ,
0 commit comments