Inline shared PHP-CS-Fixer rules into the Rules class#39
Merged
Conversation
Move the rule array from the root .php-cs-fixer-rules.php into Rules::get() so the ruleset is a single PSR-4 autoloaded source with no file-path indirection (dirname(__DIR__, 2) require). The raw-require fallback the root file provided was never documented as public API, so this is safe on the unreleased 1.x line. Also keep '@api' out of general_phpdoc_annotation_remove: the standard was stripping the @api tags that mark the supported public surface (found by running the shared config on this package's own code).
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.
Summary
Moves the shared PHP-CS-Fixer rule array from the root
.php-cs-fixer-rules.phpintoRules::get(), and deletes the root file. The ruleset is now a single PSR-4 autoloaded source with no file-path indirection.Targets the unreleased
1.xbranch, so the (undocumented) raw-requirefallback the root file offered can be dropped without a BC concern.Changes
IxDFCodingStandard/PhpCsFixer/Rules.php: rule array inlined intoget(); dropped thedirname(__DIR__, 2)requireand the now-unneeded static cache. Kept@apiand the localheinz reference..php-cs-fixer-rules.php.'api'out ofgeneral_phpdoc_annotation_removeso the standard no longer strips the@apitags that mark the supported public surface (caught by running the shared config on this package's own code).Verification
Rules::get()resolves to 149 effective rules viaRuleSet.vendor/bin/phpunit: 18 passing.