magento-coding-standard
magento-coding-standard copied to clipboard
Fix Class Property DocBlock sniff for union/intersection types
Since PHP_CodeSniffer 3.7.0, there's a separate token T_TYPE_INTERSECTION
for the &
type-intersection specifier, instead of using the same T_BITWISE_AND
token for both type intersections and the bitwise operator. Due to this, the Magento2.Commenting.ClassPropertyPHPDocFormatting
sniff fails to detect the DocBlock for intersection-typed properties in projects that use newer versions.
Also, since PHP 8.2 added support for DNF types, two new tokens were added to PHP_CodeSniffer in 3.10.0 for the parentheses.
This PR proposes pinning the minimum PHP_CodeSniffer version to ^3.10.0
in order to fully support the newer DNF types, while also fixing the sniff's allowed tokens to correctly detect DocBlocks for intersection-typed properties.