[feature] Make ecs.php extensible instead of fully replaceable#19
Merged
[feature] Make ecs.php extensible instead of fully replaceable#19
Conversation
- Add ECSConfig class with static configure() method returning ECSConfigBuilder
- Update ecs.php to use ECSConfig::configure()
- Remove CodeStyleCommand changes (extra-config option)
- Add PHPDoc explaining extension pattern in ECSConfig class
Usage example in consumer project:
$config = \FastForward\DevTools\Config\ECSConfig::configure();
$config->withRules([CustomRule::class]);
$config->withConfiguredRule(PhpdocAlignFixer::class, ['align' => 'right']);
return $config;
Implements: #6
ba2b6c6 to
92a7505
Compare
- Add 'Extending ECS Configuration' section to overriding-defaults.rst - Add FAQ entry explaining how to extend ECS configuration Refs: #6
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
ECSConfigclass inFastForward\DevTools\Confignamespace with staticconfigure()methodECSConfigBuilderwith the default ECS configurationecs.phpto use the new classChanges
src/Config/ECSConfig.phpwith static configure() methodecs.phpto useECSConfig::configure()Usage Example
In a consumer project, create
ecs.phpthat extends the default configuration:This allows consumers to:
Testing
All tests pass (88 tests, 243 assertions).
Closes #6