Index
extends Command
in package
Class Index.
Table of Contents
Properties
- $active : bool
- Tells if command is active.
- $console : Console
- Console instance of the current command.
- $description : string
- Command description.
- $group : string
- Command group.
- $name : string
- Command name.
- $options : array<string|int, mixed>
- Command options.
- $usage : string
- Command usage.
Methods
- __construct() : mixed
- Command constructor.
- activate() : static
- Activate the command.
- deactivate() : static
- Deactivate the command.
- getConsole() : Console
- Get console instance.
- getDescription() : string
- Get command description.
- getGroup() : string|null
- Get command group.
- getName() : string
- Get command name.
- getOptions() : array<string, string>
- Get command options.
- getUsage() : string
- Get command usage.
- isActive() : bool
- Tells if the command is active.
- run() : void
- Run the command.
- setConsole() : static
- Set console instance.
- setDescription() : static
- Set command description.
- setGroup() : static
- Set command group.
- setName() : static
- Set command name.
- setOptions() : static
- Set command options.
- setUsage() : static
- Set command usage.
- editDescription() : string
- getUser() : string
- getWidthAndLengths() : array<string|int, array<string, int>|int>
- greet() : void
- listCommands() : void
- showDate() : void
- showHeader() : void
Properties
$active
Tells if command is active.
protected
bool
$active
= true
$console
Console instance of the current command.
protected
Console
$console
$description
Command description.
protected
string
$description
= 'Show commands list'
$group
Command group.
protected
string
$group
$name
Command name.
protected
string
$name
= 'index'
$options
Command options.
protected
array<string|int, mixed>
$options
= ['-g' => 'Shows greeting.']
$usage
Command usage.
protected
string
$usage
= 'index'
Methods
__construct()
Command constructor.
public
__construct([Console|null $console = null ]) : mixed
Parameters
- $console : Console|null = null
activate()
Activate the command.
public
activate() : static
Return values
staticdeactivate()
Deactivate the command.
public
deactivate() : static
Return values
staticgetConsole()
Get console instance.
public
getConsole() : Console
Return values
ConsolegetDescription()
Get command description.
public
getDescription() : string
Return values
stringgetGroup()
Get command group.
public
getGroup() : string|null
Return values
string|nullgetName()
Get command name.
public
getName() : string
Return values
stringgetOptions()
Get command options.
public
getOptions() : array<string, string>
Return values
array<string, string>getUsage()
Get command usage.
public
getUsage() : string
Attributes
- #[Pure]
Return values
stringisActive()
Tells if the command is active.
public
isActive() : bool
Attributes
- #[Pure]
Return values
boolrun()
Run the command.
public
run() : void
setConsole()
Set console instance.
public
setConsole(Console $console) : static
Parameters
- $console : Console
Return values
staticsetDescription()
Set command description.
public
setDescription(string $description) : static
Parameters
- $description : string
Return values
staticsetGroup()
Set command group.
public
setGroup(string $group) : static
Parameters
- $group : string
Return values
staticsetName()
Set command name.
public
setName(string $name) : static
Parameters
- $name : string
Return values
staticsetOptions()
Set command options.
public
setOptions(array<string, string> $options) : static
Parameters
- $options : array<string, string>
Return values
staticsetUsage()
Set command usage.
public
setUsage(string $usage) : static
Parameters
- $usage : string
Return values
staticeditDescription()
protected
editDescription(string $description) : string
Parameters
- $description : string
Return values
stringgetUser()
protected
getUser() : string
Return values
stringgetWidthAndLengths()
protected
getWidthAndLengths(array<string, Command> $commands) : array<string|int, array<string, int>|int>
Parameters
- $commands : array<string, Command>
Return values
array<string|int, array<string, int>|int>greet()
protected
greet() : void
listCommands()
protected
listCommands() : void
showDate()
protected
showDate() : void
showHeader()
protected
showHeader() : void