Skip to content

Support Symfony 8 container integration - #2

Merged
gabrielsolomon merged 1 commit into
masterfrom
copilot/symfony-8-compat
Nov 22, 2026
Merged

gabrielsolomon merged 1 commit into
masterfrom
copilot/symfony-8-compat

Conversation

@gabrielsolomon

Copy link
Copy Markdown
Contributor

Summary

  • Allow Symfony DependencyInjection 8 while retaining support for Symfony 5.3 through 7.
  • Accept and expose native Symfony containers while preserving legacy providers, aliases, and reflection resolution.
  • Declare runtime dependencies, modernize test dependencies, document Symfony integration, and add a compatibility CI matrix.

Validation

  • PHPUnit passed locally with Symfony DependencyInjection 5.4, 6.4, 7.4, and 8.0 on PHP 8.5.
  • A production-only installation was verified with Symfony Config and DependencyInjection 8.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@gabrielsolomon
gabrielsolomon marked this pull request as ready for review November 22, 2026 18:57
Copilot AI balanced review requested due to automatic review settings November 22, 2026 18:57
@gabrielsolomon
gabrielsolomon merged commit 92ee6b1 into master Nov 22, 2026
9 of 12 checks passed
@gabrielsolomon
gabrielsolomon deleted the copilot/symfony-8-compat branch November 22, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants