Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Avoid incompatibility with symfony/console 7 #52923

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

Merged
merged 1 commit into from
Dec 8, 2023
Merged

Avoid incompatibility with symfony/console 7 #52923

merged 1 commit into from
Dec 8, 2023

Conversation

jdecool
Copy link
Contributor

@jdecool jdecool commented Dec 7, 2023

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:

{
    "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:

!!
!!  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 {#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.

@carsonbot carsonbot added this to the 5.4 milestone Dec 7, 2023
@jdecool jdecool changed the title Avoid incompatibility with symfony/console 7 [FrameworkBundle] Avoid incompatibility with symfony/console 7 Dec 7, 2023
@carsonbot carsonbot changed the title [FrameworkBundle] Avoid incompatibility with symfony/console 7 Avoid incompatibility with symfony/console 7 Dec 8, 2023
@fabpot
Copy link
Member

fabpot commented Dec 8, 2023

Thank you @jdecool.

@fabpot fabpot merged commit a3361bd into symfony:5.4 Dec 8, 2023
@jdecool jdecool deleted the fix-console-conflict branch December 8, 2023 14:13
@xabbuh
Copy link
Member

xabbuh commented Dec 8, 2023

Not sure how helpful this change actually is as Composer could simply stick with FrameworkBundle 5.4.32 or lower and still install version 7 of the Console component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.