CommandRegistry implements CommandLoaderInterface

Registry for Symfony commands, populated via dependency injection tags

Table of Contents

Interfaces

CommandLoaderInterface

Properties

$aliases  : array[]
Map of command aliases
$commandConfigurations  : array[]
Map of command configurations with the command name as key
$container  : ContainerInterface

Methods

__construct()  : mixed
addLazyCommand()  : void
filter()  : array
Gets the commands (registered in the given namespace if provided).
get()  : Command
{@inheritdoc}
getCommandByIdentifier()  : Command
getNames()  : array
{@inheritdoc}
getNamespaces()  : array
getSchedulableCommands()  : Generator
Get all commands which are allowed for scheduling recurring commands.
getSchedulableCommandsConfiguration()  : array
Get the configuration form all commands which are schedulable.
has()  : bool
{@inheritdoc}
getInstance()  : Command

Properties

$aliases

Map of command aliases

protected array[] $aliases = []

$commandConfigurations

Map of command configurations with the command name as key

protected array[] $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

The array keys are the full names and the values the command instances.

Parameters
$namespace : string|null = null
Internal
Return values
array —

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
Return values
array

getNamespaces()

public getNamespaces() : array
Internal
Return values
array

getSchedulableCommands()

Get all commands which are allowed for scheduling recurring commands.

public getSchedulableCommands() : Generator
Deprecated

since TYPO3 v15.0, will be removed in TYPO3 v16.0. Use getSchedulableCommandsConfiguration() instead.

Return values
Generator

getSchedulableCommandsConfiguration()

Get the configuration form all commands which are schedulable.

public getSchedulableCommandsConfiguration() : array

By using the #[AsNonSchedulableCommand] attribute, all commands are filtered out which utilize this attribute, as the Symfony #[AsCommand] attribute does not allow to set additional meta-data.

Return values
array

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