class ArgsRemapper (View source)

Map commandline arguments from one value to another during preflight.

Properties

protected $remapOptions
protected $remapCommandAliases

Methods

__construct($remapOptions, $remapCommandAliases)

ArgsRemapper constructor

remap(string[] $argv)

Given an $argv array, apply all remap operations on each item within it.

string
checkRemap(string $arg, string $sawCommand)

Check to see if the provided single arg needs to be remapped. If it does, then the remapping is performed.

remapOptions($arg)

No description

remapCommandAlias($arg)

No description

bool
matches(string $arg, string $candidate)

Check to see if the provided single arg matches the candidate.

Details

__construct($remapOptions, $remapCommandAliases)

ArgsRemapper constructor

Parameters

$remapOptions
$remapCommandAliases

remap(string[] $argv)

Given an $argv array, apply all remap operations on each item within it.

Parameters

string[] $argv

protected string checkRemap(string $arg, string $sawCommand)

Check to see if the provided single arg needs to be remapped. If it does, then the remapping is performed.

Parameters

string $arg One argument to inspect
string $sawCommand True if drush command was found

Return Value

string The altered argument

protected remapOptions($arg)

Parameters

$arg

protected remapCommandAlias($arg)

Parameters

$arg

protected bool matches(string $arg, string $candidate)

Check to see if the provided single arg matches the candidate.

If the candidate is --foo, then we will match the exact string --foo, or the leading substring --foo=, and nothing else.

Parameters

string $arg
string $candidate

Return Value

bool