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
Missing handling of array-type in ArrayInput::getFirstArgument #52580
Comments
@niklaswolf it seems that's not a bug but It possible to add a check if it's an array or not ( |
If that is not the intended usage, then it is strange why there is handling for the value being an array in every other method of this class, see for example here:
|
The first argument |
The usecase is this: https://github.com/shopware/shopware/blob/540d526e61e32c7065d1eae6d74a81f5e1728cb9/src/Core/TestBootstrapper.php#L396C42-L396C42 There a command is programmatically triggered, which needs the (only) argument |
It's more clear now, Thanks I think the issue can be resolved in the shopware core
|
No this is not the solution, I tried it and got the following error:
|
I didn't use shopware before (what i wrote, it was a suggestion that can help you to resolve your problem) |
I mean something like that:
|
The docs for that were optimized in https://github.com/symfony/symfony-docs/pull/18741/files, hope this helps. |
Okay I created an issue at Shopware for that. Nevertheless I stand by my point that it is strange that there is handling for the value of the first argument beeing an array in other methods of this class, but not in But if there is no intention to adjust this, this issue can be closed I think. |
Symfony version(s) affected
7.0
Description
In contrast to other methods in this class, in ArrayInput::getFirstArgument there is no handling of the case that the value of the first parameter is of type Array.
symfony/src/Symfony/Component/Console/Input/ArrayInput.php
Line 40 in 6c91073
If this is the case, there is a type error:
How to reproduce
Initialize ArrayInput with an array-value as the first argument, e.g.
Possible Solution
mixed
or allow array as a return typeAdditional Context
No response
The text was updated successfully, but these errors were encountered: