Closed jrfnl closed 1 year ago
Note: I've updated the commit to contain yet more unit tests.
FYI: this fix is included in today's PHP_CodeSniffer 3.8.0 release.
As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo).
PHPCS re-tokenizes the
self
,parent
,true
,false
andnull
keywords to a PHPCS native token.This re-tokenization did not take the following situations into account:
Additionally, the PHP native
T_STATIC
token would not be (re-)tokenized toT_STRING
when used as a function call, though it was tokenized correctly when used as a method call. While using thestatic
keyword for a global function declaration is illegal in PHP, the tokenization in PHPCS should still be consistent.This commit fixes those issues.
Includes additional unit tests.
These issues were discovered while investigating issue PHPCompatibility/PHPCompatibility#1489