Replace illuminate/container with entropy container#13
Open
TomasVotruba wants to merge 1 commit into
Open
Conversation
ECSConfig now extends Entropy\Container\Container instead of Illuminate's: - Checkers are registered as container service factories that autowire (via Container::build()) then apply their configuration; collectors receive them through docblock array autowiring / findByContract instead of Laravel tags and contextual bindings (when()->needs()->giveTagged()). - findByContract() is overridden to preserve checker registration order and the documented duplicate-in-set behaviour (discussion #198). - Compiler passes operate on ECSConfig::getCheckerClasses()/removeChecker() instead of Laravel getBindings()/offsetUnset()/tags reflection. - LazyContainerFactory registers custom-factory services via service(); plain services are autowired and cached by the container. Removes the illuminate/container dependency and its patch. entropy/entropy is temporarily pinned to the feature branch (TomasVotruba/entropy#8) via a VCS repository until that PR is merged. symfony/console is intentionally untouched: it remains a transitive dependency of friendsofphp/php-cs-fixer and symplify/easy-parallel, so it cannot be removed from the install tree.
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.
Migrates the dependency-injection container from illuminate/container to entropy/entropy's container, and removes
illuminate/container(and its patch) entirely.Depends on TomasVotruba/entropy#8 (entropy gains
Container::build()and becomes extendable). entropy is temporarily pinned to that feature branch via a VCSrepositoriesentry; once #8 is merged this should revert todev-main/ a tagged release and therepositoriesentry removed.What changed
ECSConfignow extendsEntropy\Container\Container.Container::build()), then apply its configuration (replacing Laravel'sextend()), and are looked up viafindByContract()instead of tags + contextual binding (when()->needs()->giveTagged()).findByContract()is overridden to keep registration order and the documented "same rule in a set + explicitly = listed twice, last config wins" behaviour (discussion #198).ECSConfig::getCheckerClasses()/removeChecker()instead ofgetBindings()/offsetUnset()/ tags reflection.LazyContainerFactoryregisters custom-factory services withservice(); everything else is autowired & cached by the container.FileHashComputerhashesgetCheckerConfiguration()(checkers + their config) instead ofgetBindings().FixerFileProcessor,SniffFileProcessor,OutputFormatterCollector) keep their existing@param X[]docblocks and are now autowired through docblock array injection.illuminate/containerfromcomposer.jsonand deletedpatches/illuminate-container-container-php.patch.Scope note — symfony/console is NOT removed
symfony/consoleis a transitive dependency offriendsofphp/php-cs-fixerandsymplify/easy-parallel, so it cannot be removed from the install tree. This PR is container-only; the console layer still uses symfony/console. (entropy#8 already contains the console features — progress bar, styled output, default/hidden commands — for a future console migration.)Verification
All green locally (PHP 8.4): PHPStan level 8, Rector (dry-run),
bin/ecs check, PHPUnit (94 tests). End-to-endbin/ecs check/list-checkersverified against sample files.