@@ -1468,16 +1468,18 @@ protected function tokenize($string)
14681468 $ newToken ['type ' ] = 'T_ATTRIBUTE ' ;
14691469 $ newToken ['content ' ] = '#[ ' ;
14701470 $ finalTokens [$ newStackPtr ] = $ newToken ;
1471+ $ newStackPtr ++;
14711472
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 ] = '] ' ;
14751477
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+ }
14781481 }
14791482
1480- $ newStackPtr ++;
14811483 continue ;
14821484 }//end if
14831485
@@ -2266,7 +2268,7 @@ protected function tokenize($string)
22662268 }
22672269
22682270 if ($ prevNonEmpty === null
2269- && isset (Tokens::$ emptyTokens [$ tokenType ]) === false
2271+ && @ isset (Tokens::$ emptyTokens [$ tokenType ]) === false
22702272 ) {
22712273 // Found the previous non-empty token.
22722274 if ($ tokenType === ': ' || $ tokenType === ', ' || $ tokenType === T_ATTRIBUTE_END ) {
@@ -2285,8 +2287,8 @@ protected function tokenize($string)
22852287
22862288 if ($ tokenType === T_FUNCTION
22872289 || $ 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
22902292 || $ tokenType === T_VAR
22912293 || $ tokenType === T_READONLY
22922294 ) {
@@ -2309,7 +2311,7 @@ protected function tokenize($string)
23092311 break ;
23102312 }
23112313
2312- if (isset (Tokens::$ emptyTokens [$ tokenType ]) === false ) {
2314+ if (@ isset (Tokens::$ emptyTokens [$ tokenType ]) === false ) {
23132315 $ lastSeenNonEmpty = $ tokenType ;
23142316 }
23152317 }//end for
0 commit comments