Property | Type | Description | |
---|---|---|---|
$path | string | The file system path to a VCS binary |
Method | Description | |
---|---|---|
__call ( string $method, array $arguments ) : |
Method overloading - allows calling VCS commands directly as class methods | |
__construct ( string $path ) | Creates a VCS binary interface | |
createCall ( string $path, string $command, array $arguments ) : |
Create a call to the VCS binary for later execution | |
ensure ( |
Ensures that the given arguments is a valid VCS binary |
Method | Description | |
---|---|---|
createCallCommand ( string $binary, string $command, array $args, array $files ) : string | Creates the command string to be executed | |
doCreateCall ( string $cmd, string $path ) : |
The call factory | |
extractCallParametersFromMagicCall ( string $method, array $arguments ) : array | Extracts the CLI call parameters from the arguments to a magic method call | |
isWindows ( ) : boolean | Checks if the current system is Windows | |
sanitizeCommandArgument ( string $key, string $value ) : string | Sanitizes a command line argument | |
sanitizeCommandArguments ( array $arguments ) : array | Sanitizes a list of command line arguments and splits them into args and files |
public __construct ( string $path ) | ||
$path | string | The path to the VCS binary |
protected createCallCommand ( string $binary, string $command, array $args, array $files ) : string | ||
$binary | string | The path to the binary |
$command | string | The VCS command |
$args | array | The list of command line arguments (sanitized) |
$files | array | The list of files to be added to the command line call |
return | string | The command string to be executed |
protected doCreateCall ( string $cmd, string $path ) : |
||
$cmd | string | The command string to be executed |
$path | string | The working directory |
return |
protected extractCallParametersFromMagicCall ( string $method, array $arguments ) : array | ||
$method | string | The VCS command, e.g. show, commit or add |
$arguments | array | The command arguments with the path to the VCS repository being the first argument |
return | array | An array with (path, method, args, stdIn) |
protected sanitizeCommandArguments ( array $arguments ) : array | ||
$arguments | array | The list of arguments |
return | array | An array with (args, files) |
protected string $path | ||
return | string |