Copied!

An input specialized for shell completion.

This input allows unfinished option names or values and exposes what kind of
completion is expected.

Cloneable Final Instantiable
Constants
public Symfony\Component\Console\Completion\CompletionInput ::TYPE_ARGUMENT_VALUE = 'argument_value'
public Symfony\Component\Console\Completion\CompletionInput ::TYPE_NONE = 'none'
public Symfony\Component\Console\Completion\CompletionInput ::TYPE_OPTION_NAME = 'option_name'
public Symfony\Component\Console\Completion\CompletionInput ::TYPE_OPTION_VALUE = 'option_value'
Methods
public Symfony\Component\Console\Input\ArgvInput :: __construct ( ? array $argv = NULL , ? Symfony\Component\Console\Input\InputDefinition $definition = NULL )
public __toString () : string
public bind ( Symfony\Component\Console\Input\InputDefinition $definition ) : void
 
public Symfony\Component\Console\Input\Input :: escapeToken ( string $token ) : string
 

Escapes a token through escapeshellarg if it contains unsafe chars.

public static fromString ( string $inputStr , int $currentIndex ) : self
 

Converts a terminal string into tokens.

This is required for shell completions without COMP_WORDS support.

public static fromTokens ( array $tokens , int $currentIndex ) : self
 

Create an input based on an COMP_WORDS token list.

  • param string [] $tokens the set of split tokens (e.g. COMP_WORDS or argv)
  • param $currentIndex the index of the cursor (e.g. COMP_CWORD)
public Symfony\Component\Console\Input\Input :: getArgument ( string $name ) : ? mixed
 
public Symfony\Component\Console\Input\Input :: getArguments () : array
 
public getCompletionName () : ? string
 

The name of the input option or argument when completing a value.

  • return string | null returns null when completing an option name
public getCompletionType () : string
 

Returns the type of completion required.

TYPE_ARGUMENT_VALUE when completing the value of an input argument
TYPE_OPTION_VALUE when completing the value of an input option
TYPE_OPTION_NAME when completing the name of an input option
TYPE_NONE when nothing should be completed

  • return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component
public getCompletionValue () : string
 

The value already typed by the user (or empty string).

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 mustSuggestArgumentValuesFor ( string $argumentName ) : bool
public mustSuggestOptionValuesFor ( string $optionName ) : 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 parseToken ( string $token , bool $parseOptions ) : bool
protected Symfony\Component\Console\Input\ArgvInput :: setTokens ( array $tokens )
Properties
private $completionName
private $completionType
private $completionValue
private $currentIndex
private $tokens
Methods
private getOptionFromToken ( string $optionToken ) : ? Symfony\Component\Console\Input\InputOption
private getRelevantToken () : string
 

The token of the cursor, or the last token if the cursor is at the end of the input.

private isCursorFree () : bool
 

Whether the cursor is "free" (i.e. at the end of the input preceded by a space).

Methods
public static fromString ( string $inputStr , int $currentIndex ) : self
 

Converts a terminal string into tokens.

This is required for shell completions without COMP_WORDS support.

public static fromTokens ( array $tokens , int $currentIndex ) : self
 

Create an input based on an COMP_WORDS token list.

  • param string [] $tokens the set of split tokens (e.g. COMP_WORDS or argv)
  • param $currentIndex the index of the cursor (e.g. COMP_CWORD)
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration