class ArgsPreprocessor (View source)

Preprocess commandline arguments.

  • Record @sitealias, if present
  • Record a limited number of global options

Anything not handled here is processed by Symfony Console.

Properties

protected SiteSpecParser $specParser
protected ArgsRemapper $remapper

Methods

__construct()

ArgsPreprocessor constructor

setArgsRemapper(ArgsRemapper $remapper)

No description

parse(string[] $argv, PreflightArgsInterface $storage)

Parse the argv array.

static 
nextCouldBeValue($argv)

nextCouldBeValue determines whether there is a next argument that exists and does not begin with a -.

bool
isAliasOrSiteSpec(string $arg)

Determine whether the provided argument is an alias or a site specification.

findMethodForOptionWithValues($optionsTable, $opt)

No description

checkMatchingOption($opt, $keyParam, $methodName)

No description

Details

__construct()

ArgsPreprocessor constructor

setArgsRemapper(ArgsRemapper $remapper)

Parameters

ArgsRemapper $remapper

parse(string[] $argv, PreflightArgsInterface $storage)

Parse the argv array.

Parameters

string[] $argv Commandline arguments. The first element is the path to the application, which we will ignore.
PreflightArgsInterface $storage A storage object to hold the arguments we remove from argv, plus the remaining argv arguments.

static protected nextCouldBeValue($argv)

nextCouldBeValue determines whether there is a next argument that exists and does not begin with a -.

Parameters

$argv

protected bool isAliasOrSiteSpec(string $arg)

Determine whether the provided argument is an alias or a site specification.

Parameters

string $arg Argument to test.

Return Value

bool

protected findMethodForOptionWithValues($optionsTable, $opt)

Parameters

$optionsTable
$opt

protected checkMatchingOption($opt, $keyParam, $methodName)

Parameters

$opt
$keyParam
$methodName