@@ -1531,16 +1531,18 @@ protected function tokenize($string)
1531
1531
$ newToken ['type ' ] = 'T_ATTRIBUTE ' ;
1532
1532
$ newToken ['content ' ] = '#[ ' ;
1533
1533
$ finalTokens [$ newStackPtr ] = $ newToken ;
1534
+ $ newStackPtr ++;
1534
1535
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 ] = '] ' ;
1538
1540
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
+ }
1541
1544
}
1542
1545
1543
- $ newStackPtr ++;
1544
1546
continue ;
1545
1547
}//end if
1546
1548
@@ -2187,7 +2189,7 @@ protected function tokenize($string)
2187
2189
}
2188
2190
2189
2191
if ($ prevNonEmpty === null
2190
- && isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false
2192
+ && @ isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false
2191
2193
) {
2192
2194
// Found the previous non-empty token.
2193
2195
if ($ tokenType === ': ' || $ tokenType === ', ' || $ tokenType === T_ATTRIBUTE_END ) {
@@ -2206,8 +2208,8 @@ protected function tokenize($string)
2206
2208
2207
2209
if ($ tokenType === T_FUNCTION
2208
2210
|| $ 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
2211
2213
|| $ tokenType === T_VAR
2212
2214
|| $ tokenType === T_READONLY
2213
2215
) {
@@ -2230,7 +2232,7 @@ protected function tokenize($string)
2230
2232
break ;
2231
2233
}
2232
2234
2233
- if (isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false ) {
2235
+ if (@ isset (Tokens::EMPTY_TOKENS [$ tokenType ]) === false ) {
2234
2236
$ lastSeenNonEmpty = $ tokenType ;
2235
2237
}
2236
2238
}//end for
0 commit comments