API Documentation (v0.9.0-alpha)

Avolutions\Command\CommandCollection

implements CollectionInterface Uses CollectionTrait

The CommandCollection contains all Commands from core and app.

Properties

Property Visibility Type Description
$items public array The items of the Collection.

Methods

Method Visibility Description
__construct() public Creates a new CommandCollection instance with all Commands added.
count() public Returns the number of items in the Collection.
getAll() public Returns all items of the Collection.
getByName() public Returns a Command by its name.

Property Details

$items

The items of the Collection.

public array<string|int, mixed> $items = []

Method Details

__construct()

Creates a new CommandCollection instance with all Commands added.

public __construct(Application $Application) : mixed
Parameters

Application $Application
Application instance.

count()

Returns the number of items in the Collection.

public count() : int
Return values
int Returns the number of items in the Collection.
getAll()

Returns all items of the Collection.

public getAll() : array<string|int, mixed>
Return values
array<string|int, mixed> Returns all items of the Collection.
getByName()

Returns a Command by its name.

public getByName(string $commandName) : string|null
Parameters

string $commandName
The command name.

Return values
string|null Returns a Command by its name.