CommandRegistry
in package
Auto-discovers and registers CLI commands from framework and plugin directories.
Scans:
- atom-framework/src/Console/Commands/ (recursive, framework commands)
- atom-ahg-plugins/{plugin}/lib/Commands/ (plugin commands)
Each command class must extend BaseCommand and define a $name property.
Table of Contents
Methods
- __construct() : mixed
- all() : array<string, array<string, string>>
- Get all discovered command names grouped by namespace.
- count() : int
- Get count of discovered commands.
- discover() : void
- Discover all command classes from known directories.
- get() : BaseCommand|null
- Get a command instance by name (lazy-loaded).
- has() : bool
- Check if a command exists.
- inNamespace() : array<string|int, mixed>
- Get all command names in a given namespace.
Methods
__construct()
public
__construct([string|null $atomRoot = null ]) : mixed
Parameters
- $atomRoot : string|null = null
all()
Get all discovered command names grouped by namespace.
public
all() : array<string, array<string, string>>
Return values
array<string, array<string, string>> —namespace => [name => description]
count()
Get count of discovered commands.
public
count() : int
Return values
intdiscover()
Discover all command classes from known directories.
public
discover() : void
get()
Get a command instance by name (lazy-loaded).
public
get(string $name[, array<string|int, mixed> $argv = [] ]) : BaseCommand|null
Parameters
- $name : string
- $argv : array<string|int, mixed> = []
Return values
BaseCommand|nullhas()
Check if a command exists.
public
has(string $name) : bool
Parameters
- $name : string
Return values
boolinNamespace()
Get all command names in a given namespace.
public
inNamespace(string $namespace) : array<string|int, mixed>
Parameters
- $namespace : string