[dx] Extend common sets + Levels with mature non-PSR-12 rules#30
Merged
Conversation
80b8849 to
a18769f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Broaden the ECS common sets with mature, non-risky PHP-CS-Fixer rules that are not part of the bundled PSR-12 set — extending the four gradual-adoption Levels and adding two new flat sets.
2 new sets · 42 new rules. Every added rule below shows a before→after example.
New set:
casing.php(SetList::CASING) — 5 rulesNew set:
cleanup.php(SetList::CLEANUP) — 5 rulesSpacesLevel— +1 ruleArrayLevel— +3 rulesDocblockLevel— +10 rulesPlus
PhpdocOrderByValueFixer(sorts annotations like@coversby value) andAlignMultilineCommentFixer(aligns leading*column).ControlStructuresLevel— control-flow (+6 rules)ControlStructuresLevel— operators, merged from former operators set (+7 rules)Extended flat sets
comments.php— +4 rulesnamespaces.php— +1 ruleWiring
SetList: new@apiconstsCASING,CLEANUPcommon.php: both new sets aggregatedwithPreparedSets(): new named argscasing,cleanup+ "already in common" conflict check + else-branch handlingNotes / decisions
ControlStructuresLevelinstead of a standalone set/level.stringsandoperatorsstandalone sets.scoper.phpleft untouched (matchesmain).NumericLiteralSeparator,AttributeEmptyParentheses,ModernSerializationMethods,OrderedTypes,OrderedTraits,FullyQualifiedStrictTypes,PhpdocAlign, plus the whole risky family.Totals
casing,cleanup)Checks
phpstan✅ ·rector✅ ·ecs✅ ·phpunit✅ (254 tests, 354 assertions)