Closed gharlan closed 1 year ago
This works:
protected function configure() { $this ->addArgument('myarg', InputArgument::REQUIRED, 'description'); } protected function execute(InputInterface $input, OutputInterface $output) { /** @psalm-trace $myarg */ $myarg = $input->getArgument('myarg');
type of $myarg is string. 👍
$myarg
string
But when I add suggestions to the argument:
$this ->addArgument('myarg', InputArgument::REQUIRED, 'description', null, ['my', 'suggestions']);
then the type of $myarg is null|string, which is wrong. For InputArgument::REQUIRED the given default value should be ignored.
null|string
InputArgument::REQUIRED
This works:
type of
$myarg
isstring
. 👍But when I add suggestions to the argument:
then the type of
$myarg
isnull|string
, which is wrong. ForInputArgument::REQUIRED
the given default value should be ignored.