File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ private function isAnonymousClass(Tokens $tokens, int $classIndex): bool
150150 }
151151
152152 // T_ATTRIBUTE '#[' marks the start of an attribute (we exit it when going backwards)
153- if ($ token ->isGivenKind ([ T_ATTRIBUTE , T_FINAL , T_READONLY ] )) {
153+ if ($ token ->isGivenKind (T_ATTRIBUTE )) {
154154 $ insideAttribute = false ;
155155 continue ;
156156 }
@@ -160,6 +160,11 @@ private function isAnonymousClass(Tokens $tokens, int $classIndex): bool
160160 continue ;
161161 }
162162
163+ // Skip modifiers that can appear between 'new' and 'class'
164+ if ($ token ->isGivenKind ([T_FINAL , T_READONLY ])) {
165+ continue ;
166+ }
167+
163168 // If we find 'new', it's an anonymous class
164169 if ($ token ->isGivenKind (T_NEW )) {
165170 return true ;
You can’t perform that action at this time.
0 commit comments