-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
Is your feature request related to a problem?
AFAICT there's no sniffs currently for attribute formatting.
It would be useful to have a sniff that detects (and fixes!) attributes not being multiline.
Describe the solution you'd like
For example:
#[MyAttribute(id: 'alpha', label: new TranslatableMarkup('Alpha'), locked: FALSE)]
should be this:
#[MyAttribute(
id: 'alpha',
label: new TranslatableMarkup('Alpha'),
locked: FALSE,
)]
Does an attribute creation count as an object creation such as new Foo(1, 2, 3)
? And do either of them count as a function call? I can see that FunctionCallSignatureSniff has a method isMultiLineCall(). Would this be the right place to start?
Additional context (optional)
- [x ] I have read the Contribution Guidelines and this is not a support question.
- [?] I intend to create a pull request to implement this feature. -- Not sure I know enough about the internals of PHPCS!