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
Rules WebimpressCodingStandard.Files.DeclareStrictTypes.BelowComment and PSR12.Files.FileHeader.IncorrectOrder contradict themselves, if the file header comment does not include both a @copyright and @license tag.
Running phpcbf on the example file, will fix the violation of WebimpressCodingStandard.Files.DeclareStrictTypes.BelowComment and open the violation of PSR12.Files.FileHeader.IncorrectOrder at the same time.
For the sake of completeness, important input from @weierophinney in Chat:
Hm... For Laminas stuff, we do need that; it's part of our style-guide, to ensure that those elements are present in every code file. For third-party consumers of our CS, it would not be.
So, I'd argue that:
If the rule about the docblock spacing is COMBINED with the copyright/license requirements, those should be separate rules.
In non-Laminas code, users would then disable the copyright/license enforcement rule. (Which, if the answer to the first point is "no, they're separate", you could do now if you can figure out the rule name; the -vv switch will tell you that.)
Not sure, if I understand it correctly. Does this mean, for Laminas code this works as expected (no code change required/desired) and for non Laminas code an exception should be defined (e.g. add documentation on how to use)?
Bug Report
Summary
Rules
WebimpressCodingStandard.Files.DeclareStrictTypes.BelowComment
andPSR12.Files.FileHeader.IncorrectOrder
contradict themselves, if the file header comment does not include both a@copyright
and@license
tag.In this report the development.config.php.dist of the Mezzio Skeleton will serve as example.
Current behavior
Running
phpcbf
on the example file, will fix the violation ofWebimpressCodingStandard.Files.DeclareStrictTypes.BelowComment
and open the violation ofPSR12.Files.FileHeader.IncorrectOrder
at the same time.How to reproduce
Detailed instructions are provided in arueckauer/strict-type-declaration-cs-issue. In summary run the following commands on development.config.php.dist.
phpcs
: Fixable violation ofWebimpressCodingStandard.Files.DeclareStrictTypes.BelowComment
(the other violation is irrelevant for this issue).phpcbf
: Fixed: 2; Remaining: 1.phpcs
: Violation ofPSR12.Files.FileHeader.IncorrectOrder
Expected behavior
Here I am not sure. Probably the file header comment should be always above the strict type declaration. But it is not clear to me...
The text was updated successfully, but these errors were encountered: