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 abstract Symfony\Component\Console\Input\InputInterface::__toString() : string
 

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

InputArguments MUST be escaped as well as the InputOption values passed to the command.

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

Processes command line arguments.

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration