You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that normally the ? ... : ... should be tokenized as T_INLINE_THEN ... T_INLINE_ELSE, however if there is a match with default branch inside the "then" part then : remains T_COLON, which can break some sniffs (in my case it's this 3rd party sniff).
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).
Describe the bug
It seems that normally the
? ... : ...
should be tokenized asT_INLINE_THEN ... T_INLINE_ELSE
, however if there is a match with default branch inside the "then" part then:
remainsT_COLON
, which can break some sniffs (in my case it's this 3rd party sniff).Code sample
This is tokenized as:
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs -vvv test.php ...
Expected behavior
Tokenize
? ... : ...
asT_INLINE_THEN ... T_INLINE_ELSE
even withmatch (...) {default => ...}
inside then branch.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: