CommandRegistry
in package
FinalYes
Contains a registry of available commands
Table of Contents
Properties
Methods
- all() : array<string|int, Command>
- Returns all commands found in the registry
- get() : Command|null
- Returns command if found in the registry
- has() : bool
- Checks if a command is available in the registry
- register() : void
- Adds new command to registry
Properties
$commands
private
array<string|int, Command>
$commands
= []
Methods
all()
Returns all commands found in the registry
public
all() : array<string|int, Command>
Return values
array<string|int, Command>get()
Returns command if found in the registry
public
get(string $name) : Command|null
Parameters
- $name : string
Return values
Command|nullhas()
Checks if a command is available in the registry
public
has(string $name) : bool
Parameters
- $name : string
Return values
boolregister()
Adds new command to registry
public
register(Command $command) : void
Parameters
- $command : Command