-
- Notifications
You must be signed in to change notification settings - Fork 514
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.13.x
Are you sure you want to change the base?
Symfony 8.0 support #2791
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
| @@ -9,10 +9,32 @@ | |
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
| ||
if ((new ReflectionMethod(Command::class, 'execute'))->hasReturnType()) { | ||
// Symfony 8 | ||
if ((new ReflectionMethod(Command::class, 'configure'))->hasReturnType()) { | ||
/** @internal */ | ||
trait CommandCompatibility | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->doConfigure(); | ||
} | ||
Comment on lines +17 to +20 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. 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.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove it in 2.13.x just to be sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue is with older versions of the bundle that don't have the | ||
| ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
return $this->doExecute($input, $output); | ||
} | ||
} | ||
// Symfony 7 | ||
} elseif ((new ReflectionMethod(Command::class, 'execute'))->hasReturnType()) { | ||
/** @internal */ | ||
trait CommandCompatibility | ||
{ | ||
/** @return void */ | ||
protected function configure() | ||
{ | ||
$this->doConfigure(); | ||
} | ||
| ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
return $this->doExecute($input, $output); | ||
| @@ -22,6 +44,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int | |
/** @internal */ | ||
trait CommandCompatibility | ||
{ | ||
/** @return void */ | ||
protected function configure() | ||
{ | ||
$this->doConfigure(); | ||
} | ||
| ||
/** | ||
* {@inheritDoc} | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
| ||
declare(strict_types=1); | ||
| ||
namespace Doctrine\ODM\MongoDB\Tools\Console\Command\Schema; | ||
| ||
use ReflectionMethod; | ||
use Symfony\Component\Console\Command\Command; | ||
| ||
// Symfony 8 | ||
if ((new ReflectionMethod(Command::class, 'configure'))->hasReturnType()) { | ||
/** @internal */ | ||
trait AbstractCommandCompatibility | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->configureCommonOptions(); | ||
} | ||
} | ||
} else { | ||
/** @internal */ | ||
trait AbstractCommandCompatibility | ||
{ | ||
/** @return void */ | ||
protected function configure() | ||
{ | ||
$this->configureCommonOptions(); | ||
} | ||
} | ||
} |
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.
The exclusion of symfony/var-exporter 8.0 should be documented with a comment explaining why it's incompatible, as mentioned in the PR description about lazy ghost objects being dropped.
Copilot uses AI. Check for mistakes.
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.
Where should it be documented?
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.
Release notes perhaps?