Skip to content

[Symfony 8] Extend the DependencyInjection Extension base class - #152

Merged
herbertroth merged 1 commit into
2026.xfrom
symfony8-di-extension
Aug 6, 2026
Merged

[Symfony 8] Extend the DependencyInjection Extension base class#152
herbertroth merged 1 commit into
2026.xfrom
symfony8-di-extension

Conversation

@herbertroth

Copy link
Copy Markdown
Member

What

Switches the bundle extension from the deprecated
Symfony\Component\HttpKernel\DependencyInjection\Extension to
Symfony\Component\DependencyInjection\Extension\Extension.

One line changes — the import. class … extends Extension is untouched, because the new parent has
the same short name.

Why it is a no-op at runtime

The deprecated class is deprecated in Symfony 8.1, and the replacement already exists in 7.4 as its
own parent
:

// vendor/symfony/http-kernel/DependencyInjection/Extension.php:23
abstract class Extension extends BaseExtension     // BaseExtension = the DependencyInjection one

So this removes a deprecated intermediate from the hierarchy. instanceof results are unchanged, no
method resolution changes, and the class stays a valid bundle extension on 7.4 today.

No public API is involved: bundle DI extensions are internal plumbing that integrators do not extend, and
the platform has no aliases, FQCN uses or instanceof coupling on this base class.

Verification

The central check gained an httpkernel-extension-import rule
(pimcore/workflows-collection-public#157, merged before this PR on purpose), so
api-scan (httpkernel-extension-import) on this PR is the test — it was failing on this branch's base
and must be green here.

Locally: all central rules extracted from the merged workflow are clean after the edit, php -l passes,
the import block is still ordered_imports-sorted (the new namespace sorts earlier, so the line moves),
and the diff is exactly one file with one insertion and one deletion.

Context

Sweep 4 of the Symfony 7.4 → 8 migration, chosen from a review of what remains doable without any BC
break
(pimcore/platform-version, runbook EXEC-EXTENSION.md). 19 repos, one line each.

🤖 Generated with Claude Code

HttpKernel's DependencyInjection\Extension is deprecated in Symfony 8.1. The
replacement already exists in 7.4 and is that class's own parent, so this only
changes the import: "class ... extends Extension" stays as written and
instanceof is unaffected.

ConfigurableExtension, which lives in the same namespace, is a separate
deprecation and is not touched.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 6, 2026 14:36
@herbertroth herbertroth added this to the 2026.3.0 milestone Aug 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

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.

Pull request overview

Verdict: LGTM. The PR replaces the deprecated Symfony HttpKernel extension parent import with its direct DependencyInjection equivalent (src/DependencyInjection/PimcoreStaticResolverExtension.php:19).

Changes:

  • Removes the deprecated intermediate base class.
  • Preserves the existing class declaration and behavior (src/DependencyInjection/PimcoreStaticResolverExtension.php:27).
  • Introduces no public API, caller, test, documentation, or changelog impact.

@herbertroth
herbertroth merged commit ce69c18 into 2026.x Aug 6, 2026
21 of 22 checks passed
@herbertroth
herbertroth deleted the symfony8-di-extension branch August 6, 2026 15:00
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants