[ Index ]

PHP Cross Reference of phpBB-3.3.7-deutsch

title

Body

[close]

/vendor/symfony/console/Input/ -> InputDefinition.php (summary)

(no description)

File Size: 404 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

InputDefinition:: (22 methods):
  __construct()
  setDefinition()
  setArguments()
  addArguments()
  addArgument()
  getArgument()
  hasArgument()
  getArguments()
  getArgumentCount()
  getArgumentRequiredCount()
  getArgumentDefaults()
  setOptions()
  addOptions()
  addOption()
  getOption()
  hasOption()
  getOptions()
  hasShortcut()
  getOptionForShortcut()
  getOptionDefaults()
  shortcutToName()
  getSynopsis()


Class: InputDefinition  - X-Ref

A InputDefinition represents a set of valid command line arguments and options.

Usage:

$definition = new InputDefinition([
new InputArgument('name', InputArgument::REQUIRED),
new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
]);

__construct(array $definition = [])   X-Ref

param: array $definition An array of InputArgument and InputOption instance

setDefinition(array $definition)   X-Ref
Sets the definition of the input.


setArguments($arguments = [])   X-Ref
Sets the InputArgument objects.

param: InputArgument[] $arguments An array of InputArgument objects

addArguments($arguments = [])   X-Ref
Adds an array of InputArgument objects.

param: InputArgument[] $arguments An array of InputArgument objects

addArgument(InputArgument $argument)   X-Ref


getArgument($name)   X-Ref
Returns an InputArgument by name or by position.

param: string|int $name The InputArgument name or position
return: InputArgument An InputArgument object

hasArgument($name)   X-Ref
Returns true if an InputArgument object exists by name or position.

param: string|int $name The InputArgument name or position
return: bool true if the InputArgument object exists, false otherwise

getArguments()   X-Ref
Gets the array of InputArgument objects.

return: InputArgument[] An array of InputArgument objects

getArgumentCount()   X-Ref
Returns the number of InputArguments.

return: int The number of InputArguments

getArgumentRequiredCount()   X-Ref
Returns the number of required InputArguments.

return: int The number of required InputArguments

getArgumentDefaults()   X-Ref
Gets the default values.

return: array An array of default values

setOptions($options = [])   X-Ref
Sets the InputOption objects.

param: InputOption[] $options An array of InputOption objects

addOptions($options = [])   X-Ref
Adds an array of InputOption objects.

param: InputOption[] $options An array of InputOption objects

addOption(InputOption $option)   X-Ref


getOption($name)   X-Ref
Returns an InputOption by name.

param: string $name The InputOption name
return: InputOption A InputOption object

hasOption($name)   X-Ref
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).

param: string $name The InputOption name
return: bool true if the InputOption object exists, false otherwise

getOptions()   X-Ref
Gets the array of InputOption objects.

return: InputOption[] An array of InputOption objects

hasShortcut($name)   X-Ref
Returns true if an InputOption object exists by shortcut.

param: string $name The InputOption shortcut
return: bool true if the InputOption object exists, false otherwise

getOptionForShortcut($shortcut)   X-Ref
Gets an InputOption by shortcut.

param: string $shortcut The Shortcut name
return: InputOption An InputOption object

getOptionDefaults()   X-Ref
Gets an array of default values.

return: array An array of all default values

shortcutToName($shortcut)   X-Ref
Returns the InputOption name given a shortcut.

param: string $shortcut The shortcut
return: string The InputOption name

getSynopsis($short = false)   X-Ref
Gets the synopsis.

param: bool $short Whether to return the short version (with options folded) or not
return: string The synopsis



Generated: Thu Mar 24 21:31:15 2022 Cross-referenced by PHPXref 0.7.1