Command `getHelper` does not work
Hey there :wave:
I updated to version 1.1.2 and now I got the following error during the analysis:
Call to an undefined method Symfony\Component\Console\Helper\HelperInterface::ask()
We do not extend directly from Symfony\Component\Console\Command\Command but have an own AbstractCommand instead. could that be a reason? Otherwise I don't see a reason why a call like this, should not work: $this->getHelper('question')->ask()
Command where the error occurs: https://github.com/shopware/shopware/blob/5.7/engine/Shopware/Bundle/MediaBundle/Commands/MediaOptimizeCommand.php#L117 Abstract command: https://github.com/shopware/shopware/blob/5.7/engine/Shopware/Commands/ShopwareCommand.php
thanks in advance and have a nice day :slightly_smiling_face: :wave:
/cc @lookyman who is the author of https://github.com/phpstan/phpstan-symfony/pull/229
Are you using https://github.com/phpstan/phpstan-symfony#analysis-of-symfony-console-commands?
sure :slightly_smiling_face:
but we also have our own console application class, which extends from the Symfony base application. I do not know, if that matters :grin:
https://github.com/shopware/shopware/blob/5.7/engine/Shopware/Components/Console/Application.php
I confirm, we also get Call to an undefined method Symfony\Component\Console\Helper\HelperInterface::ask(). with such usage:
$helper = $this->getHelper('question');
$helper->ask($input, $output, $question);
FYI: We don't use consoleApplicationLoader because we have many CLI entrypoints, each has own commands. But for helpers it shouldn't make any difference, since it's for $input methods, right?
I haven't had a chance to look at this yet. It would be much appreciated if you guys could try to debug it, and maybe send a PR. If not, I will try to find some time later this week. Thanks for understanding.
just wanted to make sure, this is not forgotten :see_no_evil: