Skip to content

use addCommands([$command]) instead of add($command) to be compatible with symfony8#773

Open
MatthiasKuehneEllerhold wants to merge 1 commit intodoctrine:6.4.xfrom
MatthiasKuehneEllerhold:symfony-console-8-compat
Open

use addCommands([$command]) instead of add($command) to be compatible with symfony8#773
MatthiasKuehneEllerhold wants to merge 1 commit intodoctrine:6.4.xfrom
MatthiasKuehneEllerhold:symfony-console-8-compat

Conversation

@MatthiasKuehneEllerhold
Copy link
Contributor

@MatthiasKuehneEllerhold MatthiasKuehneEllerhold commented Mar 5, 2026

I got this deprecation message in my logs:

E_USER_DEPRECATED: Since symfony/console 7.4: The "Symfony\Component\Console\Application::add()" method is deprecated and will be removed in Symfony 8.0, use "Symfony\Component\Console\Application::addCommand()" instead.

Sadly addCommand() was added in symfony/console 7.4, the constraint in the composer.json allows for older versions. So this workaround works for 6, 7 and 8.

Alternative suggestion: restrain symfony/console to ^7.4, then addCommand() could be used.

Im not sure if this is all it takes to be symfony/console 8.0 compatible, for my other projets this change was the only one I needed to do.

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.

1 participant