Skip to content

Conversation

@johnnynotsolucky
Copy link
Contributor

  • Updates CLI to remove usage of deprecated method since Symfony 7.4
  • Adds support for Symfony 8

Before, running ./bref with Symfony 7.4|8 installed would result in

./bref bref-cli -> main
PHP Fatal error:  Uncaught ErrorException: 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. in bref-cli/vendor/symfony/deprecation-contracts/function.php:25
Stack trace:
#0 [internal function]: Bref\Cli\Application->{closure:Bref\Cli\Application::turnWarningsIntoExceptions():85}(16384, 'Since symfony/c...', 'bref-cli/vendor/symfony/deprecation-contracts/function.php', 25)
#1 bref-cli/vendor/symfony/deprecation-contracts/function.php(25): trigger_error('Since symfony/c...', 16384)
#2 bref-cli/vendor/symfony/console/Application.php(558): trigger_deprecation('symfony/console', '7.4', 'The "%s()" meth...', 'Symfony\\Compone...', 'Symfony\\Compone...')
#3 bref-cli/src/Application.php(23): Symfony\Component\Console\Application->add(Object(Bref\Cli\Commands\Login))
#4 bref-cli/bref(14): Bref\Cli\Application->__construct()
#5 {main}
  thrown in bref-cli/vendor/symfony/deprecation-contracts/function.php on line 25

Fatal error: Uncaught ErrorException: 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. in bref-cli/vendor/symfony/deprecation-contracts/function.php:25
Stack trace:
#0 [internal function]: Bref\Cli\Application->{closure:Bref\Cli\Application::turnWarningsIntoExceptions():85}(16384, 'Since symfony/c...', 'bref-cli/vendor/symfony/deprecation-contracts/function.php', 25)
#1 bref-cli/vendor/symfony/deprecation-contracts/function.php(25): trigger_error('Since symfony/c...', 16384)
#2 bref-cli/vendor/symfony/console/Application.php(558): trigger_deprecation('symfony/console', '7.4', 'The "%s()" meth...', 'Symfony\\Compone...', 'Symfony\\Compone...')
#3 bref-cli/src/Application.php(23): Symfony\Component\Console\Application->add(Object(Bref\Cli\Commands\Login))
#4 bref-cli/bref(14): Bref\Cli\Application->__construct()
#5 {main}
  thrown in bref-cli/vendor/symfony/deprecation-contracts/function.php on line 25

After this change, the CLI works as expected.

@mnapoli
Copy link
Member

mnapoli commented Dec 2, 2025

Thank you so much!

@mnapoli mnapoli merged commit bb2903d into brefphp:main Dec 2, 2025
@johnnynotsolucky johnnynotsolucky deleted the chore/support-symfony-8 branch December 2, 2025 13:40
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.

2 participants