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
Generic/LowerCaseType: bug fix in intersection type ignore code
PR squizlabs/PHP_CodeSniffer 3581 introduced support for PHP 8.1 intersection types.
_Note: the sniff, or PHPCS itself for that matter, currently does not (yet) support PHP 8.2 DNF types. Once support for DNF types has been added, this sniff will need a further update/fix.
For now, for the purpose of this sniff, intersection types should be skipped as they cannot contain the simple types for which the case is being checked by this sniff.
However, the check for whether a type is an intersection type or not was wrong.
The `'*type_token'` key for each of these checks contains the stack pointer to the _first_ token in the type declaration, so the comparison with `T_TYPE_INTERSECTION` will always yield `false`.
This did not lead to false positives due to how the type is handled after that, but is still a bug which should be fixed.
0 commit comments