Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PSR12/FileHeader: make "SpacingAfter" and "SpacingInside" errorcodes …
…modular This changes the error codes for the `SpacingAfterBlock` and `SpacingInsideBlock` errors to modular error codes which include a reference to the type of header block, i.e. `SpacingAfterDeclareBlock`, `SpacingInsideUseFunctionBlock` etc. This allows for more selective application of the rules. Take for instance the quite common case of the header blocks all being separated by blank lines, except for the open tag and file docblock. ```php <?php /** * File docblock. */ namespace A\B\C; use B\C; ``` The modular errorcodes I'm proposing in this PR will allow for the sniff to be used to safeguard the blank lines between each section without enforcing a blank line between the PHP open tag and the file docblock using: ```xml <rule ref="PSR12.Files.FileHeader"> <exclude name="PSR12.Files.FileHeader.SpacingAfterTagBlock"/> </rule> ``` Fixes #3453
- Loading branch information