@@ -1531,16 +1531,18 @@ protected function tokenize($string)
15311531 $ newToken ['type ' ] = 'T_ATTRIBUTE ' ;
15321532 $ newToken ['content ' ] = '#[ ' ;
15331533 $ finalTokens [$ newStackPtr ] = $ newToken ;
1534+ $ newStackPtr ++;
15341535
1535- $ tokens [$ bracketCloser ] = [];
1536- $ tokens [$ bracketCloser ][0 ] = T_ATTRIBUTE_END ;
1537- $ tokens [$ bracketCloser ][1 ] = '] ' ;
1536+ if ($ bracketCloser !== null ) {
1537+ $ tokens [$ bracketCloser ] = [];
1538+ $ tokens [$ bracketCloser ][0 ] = T_ATTRIBUTE_END ;
1539+ $ tokens [$ bracketCloser ][1 ] = '] ' ;
15381540
1539- if (PHP_CODESNIFFER_VERBOSITY > 1 ) {
1540- StatusWriter::write ("* token $ bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END " , 2 );
1541+ if (PHP_CODESNIFFER_VERBOSITY > 1 ) {
1542+ StatusWriter::write ("* token $ bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END " , 2 );
1543+ }
15411544 }
15421545
1543- $ newStackPtr ++;
15441546 continue ;
15451547 }//end if
15461548
@@ -2187,7 +2189,7 @@ protected function tokenize($string)
21872189 }
21882190
21892191 if ($ prevNonEmpty === null
2190- && isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false
2192+ && @ isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false
21912193 ) {
21922194 // Found the previous non-empty token.
21932195 if ($ tokenType === ': ' || $ tokenType === ', ' || $ tokenType === T_ATTRIBUTE_END ) {
@@ -2206,8 +2208,8 @@ protected function tokenize($string)
22062208
22072209 if ($ tokenType === T_FUNCTION
22082210 || $ tokenType === T_FN
2209- || isset (Tokens::METHOD_MODIFIERS [$ tokenType ]) === true
2210- || isset (Tokens::SCOPE_MODIFIERS [$ tokenType ]) === true
2211+ || @ isset (Tokens::METHOD_MODIFIERS [$ tokenType ]) === true
2212+ || @ isset (Tokens::SCOPE_MODIFIERS [$ tokenType ]) === true
22112213 || $ tokenType === T_VAR
22122214 || $ tokenType === T_READONLY
22132215 ) {
@@ -2230,7 +2232,7 @@ protected function tokenize($string)
22302232 break ;
22312233 }
22322234
2233- if (isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false ) {
2235+ if (@ isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false ) {
22342236 $ lastSeenNonEmpty = $ tokenType ;
22352237 }
22362238 }//end for
0 commit comments