Open fredden opened 1 year ago
A sniff for this is planned to be added to the PHPCSExtra NormalizedArrays
ruleset. Once that ruleset is completely done, the Squiz.Arrays.ArrayDeclaration
sniff will be removed from PHPCSDevCS and replaced by the NormalizedArrays
standard (with potentially some customization via properties).
There is no intention to add any sniffs to PHPCSDevCS itself. That will only change if at some point the need for a 100% PHPCS sniff writing specific sniff would be identified.
This is a follow-up on https://github.com/PHPCompatibility/PHPCompatibility/pull/1586#discussion_r1273349132 so the task doesn't get lost / forgotten. We would like to have a sniff to enforce alignment of array items.
The sniff
Squiz.Arrays.ArrayDeclaration
(with itsDoubleArrowNotAligned
rule) has been reviewed and found to be not suitable / robust enough in all cases. For example, see https://github.com/PHPCompatibility/PHPCompatibility/commit/74fc5293b7e6062671c53748d2dc486ae7967e32#diff-05ae9cddcaec1e845771a7db224961439f83ef5939ec67d3a48744cb34d7e58bR106-R110It's not strictly necessary to create a new sniff in this repository to satisfy this requirement; if a suitable sniff in another standard can be identified, it's possible to use that here.