Command
in package
AbstractYes
Table of Contents
Properties
- $cli : CLImate
- Instance of the command line interface
- $description : string
- The commands decsription displayed when listening commands or in the help dialog
- $descriptionShort : string|null
- The commands decsription displayed when listening commands if null it will fallback to the description property
- $expectedArguments : array<string, array<string, mixed>>
- An array of expected arguments
- $verbose : bool
- Enable / Disable verbose
Methods
- execute() : void
- getCommandDescription() : string
- Returns the commands description
- getCommandShortDescription() : string
- Returns the short commands description
- getExpectedArguments() : array<string, array<string, mixed>>
- Returns the expected arguments and by default the class property
- info() : void
- Print a info string
- setCommandLineInterface() : void
- Sets the current command line interface
- setVerbose() : void
- Set the current verbose state
- success() : void
- Print a success string
Properties
$cli
Instance of the command line interface
protected
CLImate
$cli
= null
$description
The commands decsription displayed when listening commands or in the help dialog
protected
string
$description
= ''
$descriptionShort
The commands decsription displayed when listening commands if null it will fallback to the description property
protected
string|null
$descriptionShort
= null
$expectedArguments
An array of expected arguments
protected
array<string, array<string, mixed>>
$expectedArguments
= []
$verbose
Enable / Disable verbose
protected
bool
$verbose
= false
Methods
execute()
public
abstract execute() : void
. Execute this command
getCommandDescription()
Returns the commands description
public
getCommandDescription() : string
Return values
stringgetCommandShortDescription()
Returns the short commands description
public
getCommandShortDescription() : string
Return values
stringgetExpectedArguments()
Returns the expected arguments and by default the class property
public
getExpectedArguments(array<string|int, mixed> $argumentVector) : array<string, array<string, mixed>>
Parameters
- $argumentVector : array<string|int, mixed>
-
The unparsed argument vector, allowing for subcommands to be handled.
Return values
array<string, array<string, mixed>>info()
Print a info string
public
info(string $message[, bool $onlyVerbose = false ][, string $key = 'info' ]) : void
Parameters
- $message : string
- $onlyVerbose : bool = false
- $key : string = 'info'
setCommandLineInterface()
Sets the current command line interface
public
final setCommandLineInterface(CLImate $cli) : void
Parameters
- $cli : CLImate
setVerbose()
Set the current verbose state
public
setVerbose(bool $value) : void
Parameters
- $value : bool
success()
Print a success string
public
success(string $message[, bool $onlyVerbose = false ][, string $key = 'success' ]) : void
Parameters
- $message : string
- $onlyVerbose : bool = false
- $key : string = 'success'