MakerCommand
extends Command
in package
Table of Contents
Properties
- $cli : CLImate
- Instance of the command line interface
- $description : string
- The command description
- $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
- $maker : Maker
- Code Generator / Maker
- $shellColLength : int
- Column length
Methods
- __construct() : mixed
- Constructor
- execute() : void
- Execute this command
- 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
- removeAbsolutePathPrefix() : string
- removes the absolute path prefix from the given path
Properties
$cli
Instance of the command line interface
protected
CLImate
$cli
= null
$description
The command description
protected
string
$description
= 'Maker is an extendable toolkit to generate classes / resources for VISU projects.'
$descriptionShort
The commands decsription displayed when listening commands if null it will fallback to the description property
protected
string|null
$descriptionShort
= 'Makes stuff, like classes, commands and others'
$expectedArguments
An array of expected arguments
protected
array<string, array<string, mixed>>
$expectedArguments
= ['type' => ['description' => 'The maker type (class, command etc..)', 'castTo' => 'string'], 'dry-run' => ['prefix' => 'd', 'longPrefix' => 'dry-run', 'description' => 'Don`t apply the changes, just print them out.', 'noValue' => true], 'force' => ['prefix' => 'f', 'longPrefix' => 'force', 'description' => 'Overrides changes without asking..', 'noValue' => true]]
$verbose
Enable / Disable verbose
protected
bool
$verbose
= false
$maker
Code Generator / Maker
private
Maker
$maker
$shellColLength
Column length
private
int
$shellColLength
= 80
Methods
__construct()
Constructor
public
__construct(Maker $maker) : mixed
Parameters
- $maker : Maker
execute()
Execute this command
public
execute() : void
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'
removeAbsolutePathPrefix()
removes the absolute path prefix from the given path
private
removeAbsolutePathPrefix(string $path) : string
Parameters
- $path : string