Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR-12 is in ithe making of creating a style guide for attributes #3688

Open
snake-py opened this issue Oct 12, 2022 · 1 comment
Open

PSR-12 is in ithe making of creating a style guide for attributes #3688

snake-py opened this issue Oct 12, 2022 · 1 comment

Comments

@snake-py
Copy link

Hello,

today I noticed that code sniffer (with psr-12) will throw an error by code like this:

#[AsCommand(name: 'serveDebug')]
class ServeDebug extends ServeCommand

because the current rule seems not to take into account that one line above a class definition can be attributed the output:

FILE: /app/Console/Commands/ServeDebug.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 6 | ERROR | [x] Header blocks must be separated by a single blank
   |       |     line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

I know that they have not totally settled on a style php-fig/per-coding-style#26

I just wanted to raise awareness, because I am guessing the rule should be changed for php 8 users. I don't see that they will settle on an required additional line between the attribute and the class.

@jrfnl
Copy link
Contributor

jrfnl commented May 7, 2023

Related to #3793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants