api/symfony/Component/Console/Input/InputOption.yaml

152 lines
5.2 KiB
YAML
Raw Normal View History

2024-09-26 09:03:21 +00:00
name: InputOption
class_comment: '# * Represents a command line option.
# *
# * @author Fabien Potencier <fabien@symfony.com>'
dependencies:
- name: Command
type: class
source: Symfony\Component\Console\Command\Command
- name: CompletionInput
type: class
source: Symfony\Component\Console\Completion\CompletionInput
- name: CompletionSuggestions
type: class
source: Symfony\Component\Console\Completion\CompletionSuggestions
- name: Suggestion
type: class
source: Symfony\Component\Console\Completion\Suggestion
- name: InvalidArgumentException
type: class
source: Symfony\Component\Console\Exception\InvalidArgumentException
- name: LogicException
type: class
source: Symfony\Component\Console\Exception\LogicException
properties: []
methods:
- name: __construct
visibility: public
parameters:
- name: name
- name: shortcut
default: 'null'
- name: mode
default: 'null'
- name: description
default: ''''''
- name: default
default: 'null'
- name: suggestedValues
default: '[]'
comment: "# * Represents a command line option.\n# *\n# * @author Fabien Potencier\
\ <fabien@symfony.com>\n# */\n# class InputOption\n# {\n# /**\n# * Do not accept\
\ input for the option (e.g. --yell). This is the default behavior of options.\n\
# */\n# public const VALUE_NONE = 1;\n# \n# /**\n# * A value must be passed when\
\ the option is used (e.g. --iterations=5 or -i5).\n# */\n# public const VALUE_REQUIRED\
\ = 2;\n# \n# /**\n# * The option may or may not have a value (e.g. --yell or\
\ --yell=loud).\n# */\n# public const VALUE_OPTIONAL = 4;\n# \n# /**\n# * The\
\ option accepts multiple values (e.g. --dir=/foo --dir=/bar).\n# */\n# public\
\ const VALUE_IS_ARRAY = 8;\n# \n# /**\n# * The option allows passing a negated\
\ variant (e.g. --ansi or --no-ansi).\n# */\n# public const VALUE_NEGATABLE =\
\ 16;\n# \n# private string $name;\n# private ?string $shortcut;\n# private int\
\ $mode;\n# private string|int|bool|array|float|null $default;\n# \n# /**\n# *\
\ @param string|array|null \
\ $shortcut The shortcuts, can be null, a string of shortcuts\
\ delimited by | or an array of shortcuts\n# * @param int-mask-of<InputOption::*>|null\
\ $mode The option mode:\
\ One of the VALUE_* constants\n# * @param string|bool|int|float|array|null \
\ $default The default value\
\ (must be null for self::VALUE_NONE)\n# * @param array|\\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion>\
\ $suggestedValues The values used for input completion\n# *\n# * @throws InvalidArgumentException\
\ If option mode is invalid or incompatible"
- name: getShortcut
visibility: public
parameters: []
comment: '# * Returns the option shortcut.'
- name: getName
visibility: public
parameters: []
comment: '# * Returns the option name.'
- name: acceptValue
visibility: public
parameters: []
comment: '# * Returns true if the option accepts a value.
# *
# * @return bool true if value mode is not self::VALUE_NONE, false otherwise'
- name: isValueRequired
visibility: public
parameters: []
comment: '# * Returns true if the option requires a value.
# *
# * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise'
- name: isValueOptional
visibility: public
parameters: []
comment: '# * Returns true if the option takes an optional value.
# *
# * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise'
- name: isArray
visibility: public
parameters: []
comment: '# * Returns true if the option can take multiple values.
# *
# * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise'
- name: isNegatable
visibility: public
parameters: []
comment: '# * Returns true if the option allows passing a negated variant.
# *
# * @return bool true if mode is self::VALUE_NEGATABLE, false otherwise'
- name: setDefault
visibility: public
parameters:
- name: default
comment: '# * Sets the default value.'
- name: getDefault
visibility: public
parameters: []
comment: '# * Returns the default value.'
- name: getDescription
visibility: public
parameters: []
comment: '# * Returns the description text.'
- name: hasCompletion
visibility: public
parameters: []
comment: '# * Returns true if the option has values for input completion.'
- name: complete
visibility: public
parameters:
- name: input
- name: suggestions
comment: '# * Supplies suggestions when command resolves possible completion options
for input.
# *
# * @see Command::complete()'
- name: equals
visibility: public
parameters:
- name: option
comment: '# * Checks whether the given option equals this one.'
traits:
- Symfony\Component\Console\Command\Command
- Symfony\Component\Console\Completion\CompletionInput
- Symfony\Component\Console\Completion\CompletionSuggestions
- Symfony\Component\Console\Completion\Suggestion
- Symfony\Component\Console\Exception\InvalidArgumentException
- Symfony\Component\Console\Exception\LogicException
interfaces: []