@@ -1468,16 +1468,18 @@ protected function tokenize($string)
1468
1468
$ newToken ['type ' ] = 'T_ATTRIBUTE ' ;
1469
1469
$ newToken ['content ' ] = '#[ ' ;
1470
1470
$ finalTokens [$ newStackPtr ] = $ newToken ;
1471
+ $ newStackPtr ++;
1471
1472
1472
- $ tokens [$ bracketCloser ] = [];
1473
- $ tokens [$ bracketCloser ][0 ] = T_ATTRIBUTE_END ;
1474
- $ tokens [$ bracketCloser ][1 ] = '] ' ;
1473
+ if ($ bracketCloser !== null ) {
1474
+ $ tokens [$ bracketCloser ] = [];
1475
+ $ tokens [$ bracketCloser ][0 ] = T_ATTRIBUTE_END ;
1476
+ $ tokens [$ bracketCloser ][1 ] = '] ' ;
1475
1477
1476
- if (PHP_CODESNIFFER_VERBOSITY > 1 ) {
1477
- echo "\t\t* token $ bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END " .PHP_EOL ;
1478
+ if (PHP_CODESNIFFER_VERBOSITY > 1 ) {
1479
+ echo "\t\t* token $ bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END " .PHP_EOL ;
1480
+ }
1478
1481
}
1479
1482
1480
- $ newStackPtr ++;
1481
1483
continue ;
1482
1484
}//end if
1483
1485
@@ -2266,7 +2268,7 @@ protected function tokenize($string)
2266
2268
}
2267
2269
2268
2270
if ($ prevNonEmpty === null
2269
- && isset (Tokens::$ emptyTokens [$ tokenType ]) === false
2271
+ && @ isset (Tokens::$ emptyTokens [$ tokenType ]) === false
2270
2272
) {
2271
2273
// Found the previous non-empty token.
2272
2274
if ($ tokenType === ': ' || $ tokenType === ', ' || $ tokenType === T_ATTRIBUTE_END ) {
@@ -2285,8 +2287,8 @@ protected function tokenize($string)
2285
2287
2286
2288
if ($ tokenType === T_FUNCTION
2287
2289
|| $ tokenType === T_FN
2288
- || isset (Tokens::$ methodPrefixes [$ tokenType ]) === true
2289
- || isset (Tokens::$ scopeModifiers [$ tokenType ]) === true
2290
+ || @ isset (Tokens::$ methodPrefixes [$ tokenType ]) === true
2291
+ || @ isset (Tokens::$ scopeModifiers [$ tokenType ]) === true
2290
2292
|| $ tokenType === T_VAR
2291
2293
|| $ tokenType === T_READONLY
2292
2294
) {
@@ -2309,7 +2311,7 @@ protected function tokenize($string)
2309
2311
break ;
2310
2312
}
2311
2313
2312
- if (isset (Tokens::$ emptyTokens [$ tokenType ]) === false ) {
2314
+ if (@ isset (Tokens::$ emptyTokens [$ tokenType ]) === false ) {
2313
2315
$ lastSeenNonEmpty = $ tokenType ;
2314
2316
}
2315
2317
}//end for
0 commit comments