class InputDefinition
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),
));
__construct(array $definition = array()) Constructor. | ||
setDefinition(array $definition) Sets the definition of the input. | ||
setArguments(InputArgument[] $arguments = array()) Sets the InputArgument objects. | ||
addArguments(InputArgument[] $arguments = array()) Adds an array of InputArgument objects. | ||
addArgument(InputArgument $argument) Adds an InputArgument object. | ||
InputArgument | getArgument(string|int $name) Returns an InputArgument by name or by position. | |
bool | hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. | |
InputArgument[] | getArguments() Gets the array of InputArgument objects. | |
int | getArgumentCount() Returns the number of InputArguments. | |
int | getArgumentRequiredCount() Returns the number of required InputArguments. | |
array | getArgumentDefaults() Gets the default values. | |
setOptions(InputOption[] $options = array()) Sets the InputOption objects. | ||
addOptions(InputOption[] $options = array()) Adds an array of InputOption objects. | ||
addOption(InputOption $option) Adds an InputOption object. | ||
InputOption | getOption(string $name) Returns an InputOption by name. | |
bool | hasOption(string $name) Returns true if an InputOption object exists by name. | |
InputOption[] | getOptions() Gets the array of InputOption objects. | |
bool | hasShortcut(string $name) Returns true if an InputOption object exists by shortcut. | |
InputOption | getOptionForShortcut(string $shortcut) Gets an InputOption by shortcut. | |
array | getOptionDefaults() Gets an array of default values. | |
string | getSynopsis(bool $short = false) Gets the synopsis. |
Constructor.
Sets the definition of the input.
Sets the InputArgument objects.
Adds an array of InputArgument objects.
Adds an InputArgument object.
Returns an InputArgument by name or by position.
Returns true if an InputArgument object exists by name or position.
Gets the array of InputArgument objects.
Returns the number of InputArguments.
Returns the number of required InputArguments.
Gets the default values.
Sets the InputOption objects.
Adds an array of InputOption objects.
Adds an InputOption object.
Returns an InputOption by name.
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).
Gets the array of InputOption objects.
Returns true if an InputOption object exists by shortcut.
Gets an InputOption by shortcut.
Gets an array of default values.
Gets the synopsis.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.2/Symfony/Component/Console/Input/InputDefinition.html