Copied!

StringInput represents an input provided as a string.

Usage:

$input = new StringInput('foo --bar="foobar"');

Cloneable Instantiable
Constants
public Symfony\Component\Console\Input\StringInput ::REGEX_QUOTED_STRING = '(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)')'
public Symfony\Component\Console\Input\StringInput ::REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\)"|(?<!\\)'|$)'
 
  • deprecated since Symfony 6.1
public Symfony\Component\Console\Input\StringInput ::REGEX_UNQUOTED_STRING = '([^\s\\]+?)'
Methods
public __construct ( string $input )
 
  • param string $input A string representing the parameters from the CLI
public Symfony\Component\Console\Input\ArgvInput :: __toString () : string
 

Returns a stringified representation of the args passed to the command.

public Symfony\Component\Console\Input\Input :: bind ( Symfony\Component\Console\Input\InputDefinition $definition )
 
public Symfony\Component\Console\Input\Input :: escapeToken ( string $token ) : string
 

Escapes a token through escapeshellarg if it contains unsafe chars.

public Symfony\Component\Console\Input\Input :: getArgument ( string $name ) : ? mixed
 
public Symfony\Component\Console\Input\Input :: getArguments () : array
 
public Symfony\Component\Console\Input\ArgvInput :: getFirstArgument () : ? string
 

Returns the first argument from the raw parameters (not parsed).

public Symfony\Component\Console\Input\Input :: getOption ( string $name ) : ? mixed
 
public Symfony\Component\Console\Input\Input :: getOptions () : array
 
public Symfony\Component\Console\Input\ArgvInput :: getParameterOption ( array | string $values , array | string | int | float | bool | null $default = false , bool $onlyParams = false ) : ? mixed
 

Returns the value of a raw option (not parsed).

This method is to be used to introspect the input parameters
before they have been validated. It must be used carefully.
Does not necessarily return the correct result for short options
when multiple flags are combined in the same option.

  • param string | array $values The value(s) to look for in the raw parameters (can be an array)
  • param string | bool | int | float | array | null $default The default value to return if no result is found
  • param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
  • return mixed
public Symfony\Component\Console\Input\Input :: getStream ()
 
public Symfony\Component\Console\Input\Input :: hasArgument ( string $name ) : bool
 
public Symfony\Component\Console\Input\Input :: hasOption ( string $name ) : bool
 
public Symfony\Component\Console\Input\ArgvInput :: hasParameterOption ( array | string $values , bool $onlyParams = false ) : bool
 

Returns true if the raw parameters (not parsed) contain a value.

This method is to be used to introspect the input parameters
before they have been validated. It must be used carefully.
Does not necessarily return the correct result for short options
when multiple flags are combined in the same option.

  • param string | array $values The values to look for in the raw parameters (can be an array)
  • param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
public Symfony\Component\Console\Input\Input :: isInteractive () : bool
 
public Symfony\Component\Console\Input\Input :: setArgument ( string $name , ? mixed $value )
 
public Symfony\Component\Console\Input\Input :: setInteractive ( bool $interactive )
 
public Symfony\Component\Console\Input\Input :: setOption ( string $name , ? mixed $value )
 
public Symfony\Component\Console\Input\Input :: setStream ( $stream )
 
public Symfony\Component\Console\Input\Input :: validate ()
 
Properties
protected Symfony\Component\Console\Input\Input :: $arguments
protected Symfony\Component\Console\Input\Input :: $definition
protected Symfony\Component\Console\Input\Input :: $interactive
protected Symfony\Component\Console\Input\Input :: $options
protected Symfony\Component\Console\Input\Input :: $stream
Methods
protected Symfony\Component\Console\Input\ArgvInput :: parse ()
 

Processes command line arguments.

protected Symfony\Component\Console\Input\ArgvInput :: parseToken ( string $token , bool $parseOptions ) : bool
protected Symfony\Component\Console\Input\ArgvInput :: setTokens ( array $tokens )
Methods
private tokenize ( string $input ) : array
 

Tokenizes a string.

  • throws InvalidArgumentException When unable to parse input (should never happen)
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration