Commit a3361bd
committed
bug symfony#52923 Avoid incompatibility with symfony/console 7 (jdecool)
This PR was merged into the 5.4 branch.
Discussion
----------
Avoid incompatibility with symfony/console 7
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
The FrameworkBundle has no constraint on the `symfony/console` component.
So a project can have a `composer.json` similar to this one:
```php
{
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "^7.0",
"symfony/framework-bundle": "5.4.*"
},
}
```
Using this configuration, it will install the console component in version 7.0.1 and the framework in 5.4.32.
But this error will occur:
```text
!!
!! Fatal error: Declaration of Symfony\Bundle\FrameworkBundle\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /Users/jeremy/Workspace/personnal/bug-test/vendor/symfony/framework-bundle/Console/Application.php on line 72
!! PHP Fatal error: Declaration of Symfony\Bundle\FrameworkBundle\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /Users/jeremy/Workspace/personnal/bug-test/vendor/symfony/framework-bundle/Console/Application.php on line 72
!! Symfony\Component\ErrorHandler\Error\FatalError {symfony#16
!! #message: "Compile Error: Declaration of Symfony\Bundle\FrameworkBundle\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int"
!! #code: 0
!! #file: "./vendor/symfony/framework-bundle/Console/Application.php"
!! #line: 72
!! -error: array:4 [
!! "type" => 64
!! "message" => "Declaration of Symfony\Bundle\FrameworkBundle\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int"
!! "file" => "/Users/jeremy/Workspace/personnal/bug-test/vendor/symfony/framework-bundle/Console/Application.php"
!! "line" => 72
!! ]
!! }
!!
```
So I suggest to add a `conflict` to avoid this issue.
Commits
-------
335e8dc Avoid incompatibility with symfony/console 71 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments