$arguments
$arguments :
A InputDefinition represents a set of valid command line arguments and options.
Usage:
$definition = new InputDefinition(array(
new InputArgument('name', InputArgument::REQUIRED),
new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
));
setArguments(array<mixed,\Symfony\Component\Console\Input\InputArgument> $arguments = array())
Sets the InputArgument objects.
array<mixed,\Symfony\Component\Console\Input\InputArgument> | $arguments | An array of InputArgument objects |
addArguments(array<mixed,\Symfony\Component\Console\Input\InputArgument> $arguments = array())
Adds an array of InputArgument objects.
array<mixed,\Symfony\Component\Console\Input\InputArgument> | $arguments | An array of InputArgument objects |
addArgument(\Symfony\Component\Console\Input\InputArgument $argument)
\Symfony\Component\Console\Input\InputArgument | $argument |
When incorrect argument is given
getArgument(string|integer $name) : \Symfony\Component\Console\Input\InputArgument
Returns an InputArgument by name or by position.
string|integer | $name | The InputArgument name or position |
When argument given doesn't exist
An InputArgument object
getArguments() : array<mixed,\Symfony\Component\Console\Input\InputArgument>
Gets the array of InputArgument objects.
An array of InputArgument objects
setOptions(array<mixed,\Symfony\Component\Console\Input\InputOption> $options = array())
Sets the InputOption objects.
array<mixed,\Symfony\Component\Console\Input\InputOption> | $options | An array of InputOption objects |
addOptions(array<mixed,\Symfony\Component\Console\Input\InputOption> $options = array())
Adds an array of InputOption objects.
array<mixed,\Symfony\Component\Console\Input\InputOption> | $options | An array of InputOption objects |
addOption(\Symfony\Component\Console\Input\InputOption $option)
\Symfony\Component\Console\Input\InputOption | $option |
When option given already exist
getOption(string $name) : \Symfony\Component\Console\Input\InputOption
Returns an InputOption by name.
string | $name | The InputOption name |
When option given doesn't exist
A InputOption object
hasOption(string $name) : boolean
Returns true if an InputOption object exists by name.
This method can't be used to check if the user included the option when executing the command (use getOption() instead).
string | $name | The InputOption name |
true if the InputOption object exists, false otherwise
getOptions() : array<mixed,\Symfony\Component\Console\Input\InputOption>
Gets the array of InputOption objects.
An array of InputOption objects
getOptionForShortcut(string $shortcut) : \Symfony\Component\Console\Input\InputOption
Gets an InputOption by shortcut.
string | $shortcut | The Shortcut name |
An InputOption object