php-coding-standards
php-coding-standards copied to clipboard
[Feature Request]: Evaluate which "Slevomat" coding standard sniffs to use
Is your feature request related to a problem?
In #58 @strangerkir Proposed to make use of the "unused use" sniff from Slevomat coding standard.
As part of #70, that standard will be effectively part of the dependencies of this package.
Consider the large amount of sniff it has, we could consider to use more of them, because I can see many of them have potential to be a good addition.
But we need to gather consensus on which to use. This issue is the place where we will track that progress, even though not sure yet which will be the vest way to do such thing.
Describe the desired solution
Collect consensus on the standard to use, possibly their setting, and then require the sniffs in our rule set.
Describe the alternatives that you have considered
N/A
Additional context
N/A
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Personally, I would love to add:
Functions:
- SlevomatCodingStandard.Functions.ArrowFunctionDeclaration (If not already covered by other roles. Spacing must be defined).
Namespaces:
- SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.
- SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.
- SlevomatCodingStandard.Namespaces.MultipleUsesPerLine.
- SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash.
- SlevomatCodingStandard.Namespaces.UnusedUses.
PHP:
Type hints:
- SlevomatCodingStandard.TypeHints.UnionTypeHintFormat with
WhiteSpceset tono.
Also. here's a list of things that I would also like to add but I understand they may be too strict or anyway many people could dislike.
Type hints:
Last thing:
@gmazzap, I think you were referencing to SlevomatCodingStandard.Namespaces.UnusedUses, but I cannot see it added within #70 🤔
I would suggest SlevomatCodingStandard.ControlStructures.DisallowYodaComparison. I think we discussed it internally and most part developers agreed that warning will be okay.