class GlobalOptionsEventListener implements EventSubscriberInterface, ConfigAwareInterface (View source)

Traits

Properties

protected ConfigInterface $config from  ConfigAwareTrait
protected Application $application
protected string $prefix

Methods

$this
setConfig(ConfigInterface $config)

Set the config management object.

ConfigInterface
getConfig()

Get the config management object.

static string
configPrefix()

Any class that uses ConfigAwareTrait SHOULD override this method , and define a prefix for its configuration items. This is usually done in a base class. When used, this method should return a string that ends with a "."; see BaseTask::configPrefix().

static 
configClassIdentifier($classname)

No description

static 
configPostfix()

No description

static 
configure(string $key, mixed $value, ConfigInterface|null $config = null)

No description

mixed|null
getConfigValue(string $key, mixed|null $default = null)

No description

__construct()

GlobalOptionsEventListener listener

$this
setApplication(Application $application)

Add a reference to the Symfony Console application object.

$this
setGlobalOptionsPrefix(string $prefix)

Stipulate the prefix to use for option injection.

static 
getSubscribedEvents()

{@inheritdoc}

handleCommandEvent(ConsoleCommandEvent $event)

Run all of our individual operations when a command event is received.

setGlobalOptions(ConsoleCommandEvent $event)

Before a Console command runs, examine the global commandline options from the event Input, and set configuration values as appropriate.

setConfigurationValues(ConsoleCommandEvent $event)

Examine the commandline --define / -D options, and apply the provided values to the active configuration.

array
splitConfigKeyValue(string $value)

Split up the key=value config setting into its component parts. If the input string contains no '=' character, then the value will be 'true'.

array
applicationOptionDefaultValues()

Get default option values from the Symfony Console application, if it is available.

Details

$this setConfig(ConfigInterface $config)

Set the config management object.

Parameters

ConfigInterface $config

Return Value

$this

ConfigInterface getConfig()

Get the config management object.

Return Value

ConfigInterface

static protected string configPrefix()

Any class that uses ConfigAwareTrait SHOULD override this method , and define a prefix for its configuration items. This is usually done in a base class. When used, this method should return a string that ends with a "."; see BaseTask::configPrefix().

Return Value

string

static protected configClassIdentifier($classname)

No description

Parameters

$classname

static protected configPostfix()

No description

static configure(string $key, mixed $value, ConfigInterface|null $config = null)

No description

Parameters

string $key
mixed $value
ConfigInterface|null $config

protected mixed|null getConfigValue(string $key, mixed|null $default = null)

No description

Parameters

string $key
mixed|null $default

Return Value

mixed|null

__construct()

GlobalOptionsEventListener listener

$this setApplication(Application $application)

Add a reference to the Symfony Console application object.

Parameters

Application $application

Return Value

$this

$this setGlobalOptionsPrefix(string $prefix)

Stipulate the prefix to use for option injection.

Parameters

string $prefix

Return Value

$this

static getSubscribedEvents()

{@inheritdoc}

handleCommandEvent(ConsoleCommandEvent $event)

Run all of our individual operations when a command event is received.

Parameters

ConsoleCommandEvent $event

setGlobalOptions(ConsoleCommandEvent $event)

Before a Console command runs, examine the global commandline options from the event Input, and set configuration values as appropriate.

Parameters

ConsoleCommandEvent $event

setConfigurationValues(ConsoleCommandEvent $event)

Examine the commandline --define / -D options, and apply the provided values to the active configuration.

Parameters

ConsoleCommandEvent $event

protected array splitConfigKeyValue(string $value)

Split up the key=value config setting into its component parts. If the input string contains no '=' character, then the value will be 'true'.

Parameters

string $value

Return Value

array

protected array applicationOptionDefaultValues()

Get default option values from the Symfony Console application, if it is available.

Return Value

array