Skip to content

Call to undefined method JBZoo\Cli\CliApplication::add() #27

Description

@wildcart

I've upgraded my Composer-Graph installation today (to 7.1.0) which pulled in symfony/console 8.1.0, which unfortunately causes an error:

PHP Fatal error:  Uncaught Error: Call to undefined method JBZoo\Cli\CliApplication::add() in /home/user/.local/lib/composer/jbzoo/cli/src/CliApplication.php:77
Stack trace:
#0 /home/user/.local/lib/composer/jbzoo/composer-graph/composer-graph.php(39): JBZoo\Cli\CliApplication->registerCommandsByPath()
#1 /home/user/.local/lib/composer/jbzoo/composer-graph/composer-graph(18): require_once('...')
#2 /home/user/.local/bin/composer-graph(119): include('...')
#3 {main}
  thrown in /home/user.local/lib/composer/jbzoo/cli/src/CliApplication.php on line 77

The problem seems to be that the add function (defined in Symfony\Component\Console\Application) was deprecated in Symfony 7.4. The function was renamed to addCommand and add became a proxy calling addCommand in 7.4. In Symfony 8.0 the add proxy function was removed.

As a workaround I've pinned symfony/console to ^7.4, for now.

Thanks for providing this tool :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions