Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
Closed
Description
InputArgument::IS_ARRAY
is not documented. It can only be used at the end of the argument list and allows to take an indefinite number of arguments:
$console ->register('foo') ->setDefinition(array(newInputArgument('values', InputArgument::IS_ARRAY,'An array of arguments'), )) ->setDescription('Foo') ->setCode(function (InputInterface$input,OutputInterface$output) {print_r($input->getArgument('values')); });
if run withconsole foo a b c d e
, the argument value will be:['a', 'b', 'c', 'd', 'e']