Repository navigation
Support Symfony 8 container integration - #2
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
A critical self-binding bug in SymfonyContainer recursively resolves the same service ID, exhausting resources and requiring a resolution-path fix with a regression test.
1 open issue
What changed in this PR
This PR extends the container compatibility layer to Symfony DependencyInjection 8 and adds native Symfony container integration while retaining legacy resolution features.
Changes:
- Accept and expose native Symfony containers, with adjusted alias and service handling.
- Declare runtime dependencies, modernize test dependencies, and make nullable types explicit.
- Add integration tests, documentation, and a PHP/Symfony compatibility CI matrix.
| File | Description |
|---|---|
tests/src/ContainerTest.php |
Tests builder integration, native containers, aliases, and replacement. |
tests/src/AbstractTestCase.php |
Uses PHPUnit’s base test class directly. |
src/Traits/ContainerPersistenceTrait.php |
Makes the nullable container parameter explicit. |
src/Traits/BaseMethodsTrait.php |
Delegates removal to the bridge implementation. |
src/ReflectionContainer/Argument/LiteralArgument.php |
Makes the nullable type parameter explicit. |
src/Container.php |
Accepts an optional Symfony container. |
src/Bridges/SymfonyContainer.php |
Exposes the wrapped container and adapts native-container handling. |
README.md |
Documents Symfony integration and compatibility constraints. |
composer.json |
Allows Symfony 8 and updates runtime and test dependencies. |
.github/workflows/tests.yml |
Adds compatibility testing across PHP and Symfony versions. |
Review effort: Balanced
| if (is_string($service)) { | ||
| if (class_exists($service)) { | ||
| if ($this->symfonyContainer->isCompiled()) { | ||
| if (!$this->symfonyContainer instanceof ContainerBuilder || $this->symfonyContainer->isCompiled()) { |
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
Validation