Skip to content
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

Command must return with integer #27

Open
szhajdu opened this issue Sep 7, 2020 · 0 comments
Open

Command must return with integer #27

szhajdu opened this issue Sep 7, 2020 · 0 comments

Comments

@szhajdu
Copy link

szhajdu commented Sep 7, 2020

> ./vendor/bin/companienv
PHP Fatal error:  Uncaught TypeError: Return value of "class@anonymous in /home/sabee/test/vendor/symfony/console/Command/Command.php:261
Stack trace:
#0 /home/sabee/test/vendor/symfony/console/Application.php(916): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /home/sabee/test/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand(Object(class@anonymous), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /home/sabee/test/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/sabee/test/vendor/sroze/companienv/bin/companienv(26): Symfony\Component\Console\Applic in /home/sabee/test/vendor/symfony/console/Command/Command.php on line 261

Fatal error: Uncaught TypeError: Return value of "class@anonymous in /home/sabee/test/vendor/symfony/console/Command/Command.php on line 261

TypeError: Return value of "class@anonymous in /home/sabee/test/vendor/symfony/console/Command/Command.php on line 261

Call Stack:
    0.0003     394848   1. {main}() /home/sabee/test/vendor/sroze/companienv/bin/companienv:0
    0.0261    2206296   2. Companienv\Application->run() /home/sabee/test/vendor/sroze/companienv/bin/companienv:26
    0.0467    2542272   3. Companienv\Application->doRun() /home/sabee/test/vendor/symfony/console/Application.php:140
    0.0481    2553928   4. Companienv\Application->doRunCommand() /home/sabee/test/vendor/symfony/console/Application.php:264
    0.0481    2553928   5. class@anonymous->run() /home/sabee/test/vendor/symfony/console/Application.php:916

symfony/console version is 5.1

Since symfony/console:5.0.0 a command must return with integer, otherwise application will throw TypeError.

https://github.com/symfony/console/blob/5.0/CHANGELOG.md

Based on this, Companienv\Application::run must return 0 if everything went fine, but Companienv\Companion::fillGaps returns with void.

return $callable($input, $output);

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

No branches or pull requests

1 participant