Copied!

Input is the base class for all concrete Input classes.

Three concrete classes are provided by default:

  • ArgvInput: The input comes from the CLI arguments (argv)
  • StringInput: The input is provided as a string
  • ArrayInput: The input is provided as an array
Abstract
Methods
public __construct(?Symfony\Component\Console\Input\InputDefinition $definition = NULL)
public bind(Symfony\Component\Console\Input\InputDefinition $definition)
 
  • return void
public escapeToken(string $token) : string
 

Escapes a token through escapeshellarg if it contains unsafe chars.

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

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

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

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 getStream()
 
  • return resource
public hasArgument(string $name) : bool
public hasOption(string $name) : bool
public abstract Symfony\Component\Console\Input\InputInterface::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 isInteractive() : bool
public setArgument(string $name, ?mixed $value)
 
  • return void
public setInteractive(bool $interactive)
 
  • return void
public setOption(string $name, ?mixed $value)
 
  • return void
public setStream( $stream)
 
  • param resource $stream
  • return void
public validate()
 
  • return void
Properties
protected $arguments = []
protected $definition = NULL
protected $interactive = true
protected $options = []
protected $stream = NULL
Methods
protected abstract parse()
 

Processes command line arguments.

  • return void
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration