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

array
remap(array $argv)

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

string
checkRemap(string $arg, bool $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

array remap(array $argv)

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

Parameters

array $argv

Return Value

array

protected string checkRemap(string $arg, bool $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

bool $sawCommand

True if drush command was found

Return Value

string

The altered argument

protected remapOptions($arg)

No description

Parameters

$arg

protected remapCommandAlias($arg)

No description

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