Skip to content

Symfony7 next steps#18762

Merged
herbertroth merged 37 commits into12.xfrom
symfony7-next-steps
Oct 22, 2025
Merged

Symfony7 next steps#18762
herbertroth merged 37 commits into12.xfrom
symfony7-next-steps

Conversation

@herbertroth
Copy link
Copy Markdown
Member

@herbertroth herbertroth commented Oct 13, 2025

This pull request introduces several important changes to improve Symfony 7 compatibility, deprecate legacy templating components, and refactor service container injection for better maintainability. The most impactful updates are the deprecation of the Symfony Templating Component in favor of Twig, the introduction of a new mechanism for injecting the service container into legacy services, and various configuration and codebase cleanups.

Symfony 7 compatibility and templating deprecation

  • Deprecated the use of Symfony\Component\Templating\EngineInterface and related services in favor of using Twig\Environment directly. This affects multiple classes and services, and will be removed in version 13.0. Upgrade notes have been added to guide developers through the migration. (UPGRADE.md, bundles/CoreBundle/config/templating.yaml) [1] [2]

  • Marked pimcore.templating.engine.delegating and Symfony\Component\Templating\EngineInterface services as deprecated in configuration, with clear messages for developers. (bundles/CoreBundle/config/templating.yaml)

Service container injection refactor

  • Removed legacy container injection logic from AreabrickPass and introduced a new ContainerAwarePass compiler pass that automatically injects the service container into all services implementing the new ContainerAwareInterface. This provides backward compatibility for Symfony 6 code while preparing for Symfony 7. (bundles/CoreBundle/src/DependencyInjection/Compiler/AreabrickPass.php, bundles/CoreBundle/src/DependencyInjection/Compiler/ContainerAwarePass.php, bundles/CoreBundle/src/DependencyInjection/ContainerAwareInterface.php, bundles/CoreBundle/src/DependencyInjection/ContainerAwareTrait.php) [1] [2] [3] [4] [5] [6]

Configuration and codebase cleanup

  • Updated service configuration files to use consistent YAML formatting and added deprecation comments for affected arguments and services. (bundles/CoreBundle/config/documents.yaml, bundles/CoreBundle/config/services_workflow.yaml, bundles/CoreBundle/config/templating.yaml) [1] [2] [3] [4] [5]

Routing loader update

  • Replaced the annotation-based routing loader with an attribute-based loader for admin route normalization, aligning with Symfony 7 conventions. (bundles/CoreBundle/src/DependencyInjection/Compiler/RoutingLoaderPass.php)

Miscellaneous improvements

  • Refactored controller code to use ParameterBagHelper::getInt() for more robust parameter extraction in several places. (bundles/ApplicationLoggerBundle/src/Controller/LogController.php, bundles/CoreBundle/src/Controller/PublicServicesController.php, bundles/CoreBundle/src/EventListener/Frontend/ElementListener.php) [1] [2] [3] [4] [5] [6]

@herbertroth herbertroth self-assigned this Oct 13, 2025
@github-actions
Copy link
Copy Markdown

Review Checklist

  • Target branch (11.5 for bug fixes, others 12.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

@herbertroth herbertroth added this to the 12.3.0 milestone Oct 13, 2025
…e container; recommend injecting Twig\Environment directly
… ParameterBag instances; update controllers to utilize the new helper methods for integer and boolean retrieval.
…rrectly, ensuring default value logic is preserved.
…ameterBag methods; introduce ParameterBagHelper for safe parameter retrieval.
- Updated the Controller documentation to improve readability and formatting.
- Enhanced the Custom Routes documentation with clearer explanations and examples.
- Revised the Renderlet documentation for better structure and clarity.
- Improved the PHP API documentation for Objects, ensuring consistent formatting and clearer examples.
- Refined the Best Practice guides for integrating commerce data and using tags for filtering, enhancing clarity and organization.
- Updated various sections in the Custom Routes documentation to enhance readability and fix formatting issues.
- Improved the Renderlet documentation by clarifying configuration options and methods.
- Cleaned up the Working with PHP API documentation, ensuring consistent formatting and removing unnecessary whitespace.
- Enhanced the Integrating Commerce Data with Content documentation by refining code examples and improving structure.
- Revised the Open By External ID documentation for better clarity and consistency in code snippets.
- Improved the Using Tags for Filtering documentation by refining code examples and ensuring consistent formatting.
@herbertroth herbertroth marked this pull request as ready for review October 21, 2025 08:27
@herbertroth herbertroth requested a review from kingjia90 October 21, 2025 08:27
…eprecation warning logic and ensure proper handling in non-debug environments
@sonarqubecloud
Copy link
Copy Markdown

@herbertroth herbertroth merged commit e59be13 into 12.x Oct 22, 2025
20 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2025
@herbertroth herbertroth deleted the symfony7-next-steps branch October 22, 2025 13:10
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.

4 participants