Skip to content

Symfony 8 removed XmlFileLoader, changed to PhpFileLoader (2) - #158

Merged
dunglas merged 5 commits into
dunglas:mainfrom
wickedOne:native-lazy-objects
Jan 6, 2026
Merged

dunglas merged 5 commits into
dunglas:mainfrom
wickedOne:native-lazy-objects

Conversation

@wickedOne

Copy link
Copy Markdown
Contributor

hijacking #156 from @iksmail (can't push to his main branch) in order to fix the test suite.

enables the enable_native_lazy_objects config value when php version >= 8.4.0 and doctrine/orm ^3.0

@wickedOne wickedOne changed the title Native lazy objects Symfony 8 removed XmlFileLoader, changed to PhpFileLoader (2) Dec 19, 2025
@wickedOne

Copy link
Copy Markdown
Contributor Author

@dunglas tests are green as requested; a merge & release would be highly appreciated

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

This pull request migrates the bundle's service configuration from XML to PHP format to maintain compatibility with Symfony 8, which removed XmlFileLoader. Additionally, it adds conditional support for Doctrine ORM's enable_native_lazy_objects feature when running on PHP 8.4+ with Doctrine ORM 3.0+.

Key Changes:

  • Replaced XML service definitions with PHP-based service configuration using the new Symfony DI format
  • Added version detection logic to conditionally enable native lazy objects for PHP 8.4+ with Doctrine ORM 3.0+
  • Added composer/semver as a dev dependency to support version constraint checking

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Bundle/Resources/config/services.xml Removed XML service configuration file (deprecated in Symfony 8)
src/Bundle/Resources/config/services.php Added new PHP-based service configuration with equivalent service definitions
src/Bundle/DependencyInjection/DunglasDoctrineJsonOdmExtension.php Updated to use PhpFileLoader instead of XmlFileLoader and load services.php instead of services.xml
tests/Fixtures/AppKernel.php Added conditional configuration for enable_native_lazy_objects based on PHP and Doctrine ORM versions
composer.json Added composer/semver ^3.4 to dev dependencies for version constraint checking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Fixtures/AppKernel.php Outdated
@wickedOne
wickedOne requested a review from Copilot January 6, 2026 10:02

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Fixtures/AppKernel.php Outdated
Comment thread composer.json Outdated
@wickedOne
wickedOne requested a review from Copilot January 6, 2026 10:25

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dunglas
dunglas merged commit ebb4bd7 into dunglas:main Jan 6, 2026
6 checks passed
@dunglas

dunglas commented Jan 6, 2026

Copy link
Copy Markdown
Owner

Thank you

@wickedOne
wickedOne deleted the native-lazy-objects branch January 6, 2026 13:49
@wickedOne

Copy link
Copy Markdown
Contributor Author

@dunglas any chance this can get a release or are there any other issues that need to be resolved first?

@curry684

Copy link
Copy Markdown

Ping @dunglas, this dependency is the last one holding back a Symfony 8 upgrade on some of my projects 😄

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.

5 participants