ContainerCommandLoader
class ContainerCommandLoader implements CommandLoaderInterface
Loads commands from a PSR-11 container.
Methods
| __construct(ContainerInterface $container, array $commandMap) | |
Command | get(string $name) Loads a command. | |
bool | has(string $name) Checks if a command exists. | |
string[] | getNames() | |
Details
__construct(ContainerInterface $container, array $commandMap)
Parameters
ContainerInterface | $container | A container from which to load command services |
array | $commandMap | An array with command names as keys and service ids as values |
Command
get(string $name)
Loads a command.
Parameters
Return Value
Exceptions
bool
has(string $name)
Checks if a command exists.
Parameters
Return Value
string[]
getNames()
Return Value
string[] | All registered command names |