Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing documentation for InputArgument::IS_ARRAY #2686

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

Closed
fabpot opened this issue Jun 3, 2013 · 2 comments
Closed

Missing documentation for InputArgument::IS_ARRAY #2686

fabpot opened this issue Jun 3, 2013 · 2 comments
Labels
actionable Clear and specific issues ready for anyone to take them. Console

Comments

@fabpot
Copy link
Member

fabpot commented Jun 3, 2013

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(
        new InputArgument('values', InputArgument::IS_ARRAY, 'An array of arguments'),
    ))
    ->setDescription('Foo')
    ->setCode(function (InputInterface $input, OutputInterface $output) {
        print_r($input->getArgument('values'));
    })
;

if run with console foo a b c d e, the argument value will be: ['a', 'b', 'c', 'd', 'e']

@wouterj
Copy link
Member

wouterj commented Jun 3, 2013

I just wanted to create a ticket for this too! (someone asked it on irc yesterday)

None of the options of InputArgument is documented, that should be done the same way as the InputOption options are documented in components/console/intro. But I think this deserves its own article, like the other article in components/console.

@weaverryan
Copy link
Member

I'm pretty happy with the PR from @xabbuh that I just merged. @wouterj let me know if you can see some additional things that should be discussed.

And btw, this was great - Fabien opened an issue, Wouter commented on it, xabbuh created a PR, Wouter reviewed, xabbuh updated it, I merged it in - all within 12 hours. That's awesome!

Thanks everyone!

@xabbuh xabbuh mentioned this issue Jun 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. Console
Projects
None yet
Development

No branches or pull requests

3 participants