Skip to content

Internals Cli Interfaces CLICommand

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

cli\interfaces\CLICommand

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/cli/interfaces/CLICommand.php · Snapshot 8411f4287706.

The CLI registers command objects and executes one command, then returns to a readline loop. Help and clear have special handling in the loop.

CLICommand

Declaration and architectural role

interface CLICommand

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
getCommand public function getCommand(): string
getHelp public function getHelp(): string
getArguments public function getArguments(): array
execute public function execute(string $command, array $args = []): void
result public function result(): string

getCommand

Source line 7

public function getCommand(): string;

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

getHelp

Source line 8

public function getHelp(): string;

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

getArguments

Source line 9

public function getArguments(): array;

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

execute

Source line 10

public function execute(string $command, array $args = []): void;

Parameters

Parameter Type, modifiers and default Purpose
$command string $command Operation input; the exact use, validation and propagation are shown in the implementation trace.
$args array $args = [] Ordered arguments passed to the command or method.

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

result

Source line 17

public function result(): string;

Result should be in the format:

@return string

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

Clone this wiki locally