CommandRegistry implements CommandLoaderInterface, SingletonInterface
Registry for Symfony commands, populated via dependency injection tags
Table of Contents
Interfaces
- CommandLoaderInterface
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $aliases : array<string|int, array<string|int, mixed>>
- Map of command aliases
- $commandConfigurations : array<string|int, array<string|int, mixed>>
- Map of command configurations with the command name as key
- $container : ContainerInterface
Methods
- __construct() : mixed
- addLazyCommand() : void
- filter() : array<string|int, mixed>
- Gets the commands (registered in the given namespace if provided).
- get() : mixed
- {@inheritdoc}
- getCommandByIdentifier() : Command
- getNames() : mixed
- {@inheritdoc}
- getNamespaces() : array<string|int, mixed>
- getSchedulableCommands() : Generator
- Get all commands which are allowed for scheduling recurring commands.
- has() : mixed
- {@inheritdoc}
- getInstance() : Command
Properties
$aliases
Map of command aliases
protected
array<string|int, array<string|int, mixed>>
$aliases
= []
$commandConfigurations
Map of command configurations with the command name as key
protected
array<string|int, array<string|int, mixed>>
$commandConfigurations
= []
$container
protected
ContainerInterface
$container
Methods
__construct()
public
__construct(ContainerInterface $container) : mixed
Parameters
- $container : ContainerInterface
addLazyCommand()
public
addLazyCommand(string $commandName, string $serviceName[, string|null $description = null ][, bool $hidden = false ][, bool $schedulable = false ][, string|null $aliasFor = null ]) : void
Parameters
- $commandName : string
- $serviceName : string
- $description : string|null = null
- $hidden : bool = false
- $schedulable : bool = false
- $aliasFor : string|null = null
filter()
Gets the commands (registered in the given namespace if provided).
public
filter([string|null $namespace = null ]) : array<string|int, mixed>
The array keys are the full names and the values the command instances.
Parameters
- $namespace : string|null = null
Return values
array<string|int, mixed> —An array of Command descriptors
get()
{@inheritdoc}
public
get(mixed $name) : mixed
Parameters
- $name : mixed
getCommandByIdentifier()
public
getCommandByIdentifier(string $identifier) : Command
Parameters
- $identifier : string
Tags
Return values
CommandgetNames()
{@inheritdoc}
public
getNames() : mixed
getNamespaces()
public
getNamespaces() : array<string|int, mixed>
Return values
array<string|int, mixed>getSchedulableCommands()
Get all commands which are allowed for scheduling recurring commands.
public
getSchedulableCommands() : Generator
Return values
Generatorhas()
{@inheritdoc}
public
has(mixed $name) : mixed
Parameters
- $name : mixed
getInstance()
protected
getInstance(string $service) : Command
Parameters
- $service : string