ContainerCommandLoader
in package
implements
CommandLoaderInterface
Loads commands from a PSR-11 container.
Tags
Table of Contents
Interfaces
Properties
- $commandMap : mixed
- $container : mixed
Methods
- __construct() : mixed
- get() : Command
- Loads a command.
- getNames() : array<string|int, string>
- has() : bool
- Checks if a command exists.
Properties
$commandMap
private
mixed
$commandMap
$container
private
mixed
$container
Methods
__construct()
public
__construct(ContainerInterface $container, array<string|int, mixed> $commandMap) : mixed
Parameters
- $container : ContainerInterface
- $commandMap : array<string|int, mixed>
-
An array with command names as keys and service ids as values
get()
Loads a command.
public
get(mixed $name) : Command
Parameters
- $name : mixed
Return values
CommandgetNames()
public
getNames() : array<string|int, string>
Return values
array<string|int, string> —All registered command names
has()
Checks if a command exists.
public
has(mixed $name) : bool
Parameters
- $name : mixed