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()  : Command
{@inheritdoc}
getCommandByIdentifier()  : Command
getNames()  : array<string|int, mixed>
{@inheritdoc}
getNamespaces()  : array<string|int, mixed>
getSchedulableCommands()  : Generator
Get all commands which are allowed for scheduling recurring commands.
has()  : bool
{@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 read-only

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
Internal

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
Internal
Return values
array<string|int, mixed>

An array of Command descriptors

get()

{@inheritdoc}

public get(string $name) : Command
Parameters
$name : string
Return values
Command

getCommandByIdentifier()

public getCommandByIdentifier(string $identifier) : Command
Parameters
$identifier : string
Tags
throws
UnknownCommandException
Return values
Command

getNames()

{@inheritdoc}

public getNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNamespaces()

public getNamespaces() : array<string|int, mixed>
Internal
Return values
array<string|int, mixed>

getSchedulableCommands()

Get all commands which are allowed for scheduling recurring commands.

public getSchedulableCommands() : Generator
Return values
Generator

has()

{@inheritdoc}

public has(string $name) : bool
Parameters
$name : string
Return values
bool

getInstance()

protected getInstance(string $service) : Command
Parameters
$service : string
Return values
Command

        
On this page

Search results