- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add PSR12 ruleset #4943
Add PSR12 ruleset #4943
Conversation
Can't wait for this :) |
Just FYI, On my side, I'm using a package of mine implementing this ruleset among some others. This is completely in sync with PHPCS and ECS. The configuration for PSR12 is here, maybe that will help. The scripts i'm using in
|
Thanks @drupol, I updated the ruleset :) |
Great, glad it helped :) |
Weird issue.
Overriding rules is not allowed ?! |
Our tests prevent having a ruleset that overrides a rule with the exact same config. |
@nicolas-grekas @fabpot This introduces changes in the |
@nicolas-grekas Having trait imports at the very beginning of classes is required by PSR-12, do you mean you don't want Symfony's coding style to follow that specific rule? The second change looks like a bug unrelated to this PR, The last change looks unrelated to this PR, |
Having trait imports at the beginning of the classes looks ok to me. |
@nicolas-grekas @julienfalque last change is related to "strict" flag for NativeConstantInvocationFixer which will be released in |
OK, then that's something that I think looking at which constants have a leading |
Like these https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v2.16.3/src/RuleSet.php#L193? The only update in 2.17 would be making it strict. |
Yes, this. PHP_INT_SIZE should be added to the list. |
This PR was merged into the 2.15 branch. Discussion ---------- Allow "const" option on PHP <7.1 This allows passing `const` to option `elements` in rulesets without runtime check like in #4943. It's also consistent with the fact that most fixers don't throw exceptions when passed allowed values that don't make sense (e.g. passing an empty array to that option). Commits ------- 1895c2a Allow "const" option on PHP <7.1
…e set (kubawerlos) This PR was merged into the 2.17-dev branch. Discussion ---------- NativeConstantInvocation - Add "PHP_INT_SIZE" to SF rule set As [requested](#4943 (comment)) by @nicolas-grekas. Added as a feature because it is [change](#3127 (comment)) request. Commits ------- fd92a7e Add "PHP_INT_SIZE" to "native_constant_invocation" in Symfony rule set configuration
Ref: #4502.