Closed
Description
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.
If this is the case, there is a type error:
Symfony\Component\Console\Input\ArrayInput::getFirstArgument(): Return value must be of type ?string, array returned
How to reproduce
Initialize ArrayInput with an array-value as the first argument, e.g.
$input = new ArrayInput(['foo' => ['value']]);
$value = $input->getFirstArgument()
Possible Solution
- change the return type to
mixed
or allow array as a return type - handle arrays another way
Additional Context
No response