Heratio Framework API Reference

CommandRegistry
in package

Auto-discovers and registers CLI commands from framework and plugin directories.

Scans:

  1. atom-framework/src/Console/Commands/ (recursive, framework commands)
  2. 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
int

discover()

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|null

has()

Check if a command exists.

public has(string $name) : bool
Parameters
$name : string
Return values
bool

inNamespace()

Get all command names in a given namespace.

public inNamespace(string $namespace) : array<string|int, mixed>
Parameters
$namespace : string
Return values
array<string|int, mixed>

        
On this page

Search results