-
Notifications
You must be signed in to change notification settings - Fork 94
Help getArgument/getOption in Symfony Console InputInterface #20
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
Comments
I am not sure this is possible, since the options are set in a different method on different objects. This would probably require a much deeper analysis of the source code then I can imagine right now. But it is a really annoying thing to ignore these errors every time, so I can give it a go. Or you can always send a PR if you have an idea how to solve it.. |
I really wonder how to configure it but PHP packages. The container isn't found and wrong types are still detected. Is there any change to do ? |
@vasilvestre You don't need a DI container to achieve this, you just need to return a configured Application instance from the |
Symfony had a few recent PRs to the Symfony console that impacted my PHPStan analysis due to PHPDoc changes:
symfony/symfony#28448
symfony/symfony#28374
symfony/symfony#28647
Bottom line:
InputInterface::getArgument
now returnsstring|string[]|null
InputInterface::getOption
returnsstring|string[]|bool|null
.In reality, they can return
string[]
only if the relative argument/option is set asInputArgument::IS_ARRAY
/InputOption::VALUE_IS_ARRAY
.Is it possible to add an aid in this package for this case? The minimum repro case is this one:
The text was updated successfully, but these errors were encountered: