Symfony\Component\Console\Input\StringInput
StringInput represents an input provided as a string.
Usage:
$input = new StringInput('foo --bar="foobar"');
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class StringInput
extends ArgvInput
{
- // constants
- const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
- const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
- // Inherited members from Input
- protected $definition;
- protected $options;
- protected $arguments;
- protected $interactive;
- // methods
- public void __construct()
- private array tokenize()
- // Inherited methods from ArgvInput
- public void __construct()
- protected void setTokens()
- protected void parse()
- public string getFirstArgument()
- public Boolean hasParameterOption()
- public mixed getParameterOption()
- public string __toString()
- // Inherited methods from Input
- public void __construct()
- public void bind()
- protected abstract void parse()
- public void validate()
- public Boolean isInteractive()
- public void setInteractive()
- public array getArguments()
- public mixed getArgument()
- public void setArgument()
- public Boolean hasArgument()
- public array getOptions()
- public mixed getOption()
- public void setOption()
- public Boolean hasOption()
- public string escapeToken()
Hierarchy
Constants
Name | Value |
---|---|
REGEX_STRING | '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)' |
REGEX_QUOTED_STRING | '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')' |
Members
protected
- $arguments
- $definition
- $interactive
- $options
Methods
private
- tokenize() — Tokenizes a string.
Inherited from Symfony\Component\Console\Input\ArgvInput
protected
- parse() — Processes command line arguments.
- setTokens()
public
- __toString() — Returns a stringified representation of the args passed to the command
- getFirstArgument() — Returns the first argument from the raw parameters (not parsed).
- getParameterOption() — Returns the value of a raw option (not parsed).
- hasParameterOption() — Returns true if the raw parameters (not parsed) contain a value.
Inherited from Symfony\Component\Console\Input\Input
protected
- parse() — Processes command line arguments.
public
- bind() — Binds the current Input instance with the given arguments and options.
- escapeToken() — Escapes a token through escapeshellarg if it contains unsafe chars
- getArgument() — Returns the argument value for a given argument name.
- getArguments() — Returns the argument values.
- getOption() — Returns the option value for a given option name.
- getOptions() — Returns the options values.
- hasArgument() — Returns true if an InputArgument object exists by name or position.
- hasOption() — Returns true if an InputOption object exists by name.
- isInteractive() — Checks if the input is interactive.
- setArgument() — Sets an argument value by name.
- setInteractive() — Sets the input interactivity.
- setOption() — Sets an option value by name.
- validate() — Validates the input.