-
-
Notifications
You must be signed in to change notification settings - Fork 513
Symfony 8.0 support #2791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.12.x
Are you sure you want to change the base?
Symfony 8.0 support #2791
Conversation
lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/AbstractCommand.php
Outdated
Show resolved
Hide resolved
d144a24
to
5781c4a
Compare
e73943c
to
230d603
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Symfony 8.0 by implementing compatibility layers for console command configurations that now require return type declarations. The main change addresses Symfony 8.0's requirement for the configure()
method to have a void
return type.
- Introduces compatibility traits to handle different Symfony versions' return type requirements for console commands
- Updates dependency constraints to include Symfony 8.0 support
- Adds CI testing for Symfony 8.0 with conditional dependency handling
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
composer.json | Updates Symfony dependencies to support version 8.0, excludes symfony/var-exporter 8.0 due to lazy ghost removal |
lib/Doctrine/ODM/MongoDB/Tools/Console/Command/CommandCompatibility.php | Adds Symfony 8.0 compatibility with return type declarations for configure() method |
lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/AbstractCommandCompatibility.php | New trait providing configure() method compatibility for schema commands |
lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/AbstractCommand.php | Refactors to use compatibility trait and renames configure to configureCommonOptions |
Various command files | Updates configure() method signatures to use doConfigure() pattern for compatibility |
.github/workflows/continuous-integration.yml | Adds Symfony 8.0 testing with conditional dependency installation |
phpcs.xml.dist | Excludes new compatibility file from PSR1 multiple classes rule |
lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/DropCommand.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, but LGTM if no changes are required.
{ | ||
parent::configure(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You remove the call to parent::configure()
here but it's not included in any of the new implementations in AbstractCommandCompatibility. Does that mean this parent call was never required?
protected function configure(): void | ||
{ | ||
$this->doConfigure(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I'm missing something but I don't think we need this trait here.
Since we already require PHP 8.1+, we should be able to use void
in child classes as per: https://3v4l.org/Mv3oq
I did something similar in https://github.com/IonBazan/composer-diff/blob/8907711f0bf74677041f7b356da2367afea44a53/src/Command/BaseTypedCommand.php#L9-L14 but that's only needed to support different PHP versions.
If the parent does not declare a return type then the child is allowed to declare one.
Summary
Dependencies blocking Symfony upgrade:
doctrine/orm
Run tests with Symfony 8 orm#12102friendsofphp/proxy-manager-lts
phpbench/phpbench
Support for Native Lazy objects is required, as Symfony 8.0 drops support for lazy ghost objects. This version will never be compatible with
symfony/var-exporter:8