CommandRegistry
in package
Table of Contents
Properties
- $commands : array<string, CommandInterface>
Methods
- __construct() : mixed
- Initialize the registry with all available commands
- getCommands() : array<string, CommandInterface>
- Get all registered commands
- register() : void
- Register a command
- run() : void
- Run a command based on arguments
Properties
$commands
private
array<string, CommandInterface>
$commands
= []
Methods
__construct()
Initialize the registry with all available commands
public
__construct() : mixed
getCommands()
Get all registered commands
public
getCommands() : array<string, CommandInterface>
Return values
array<string, CommandInterface>register()
Register a command
public
register(CommandInterface $command) : void
Parameters
- $command : CommandInterface
run()
Run a command based on arguments
public
run(array<string|int, mixed> $args) : void
Parameters
- $args : array<string|int, mixed>