ConfigForCommand
in package
implements
EventSubscriberInterface
This class is based on \Consolidation\Config\Inject\ConfigForCommand.
Will make sure that if an option is marked as array, it will be converted into an array.
Interfaces, Classes, Traits and Enums
- EventSubscriberInterface
Table of Contents
- $application : Application
- The application.
- $config : ConfigInterface
- The config.
- __construct() : mixed
- Construct new ConfigForCommand.
- getSubscribedEvents() : mixed
- {@inheritdoc}
- injectConfiguration() : mixed
- Before a Console command runs, inject configuration settings for this command into the default value of the options of this command.
- setApplication() : mixed
- Set application.
- fixInputForSymfony2() : mixed
- Fix arguments for help command.
- getHelpCommandTarget() : false|Command
- Get the help command.
- injectConfigGroupIntoOptions() : mixed
- Inject configurations for options.
- injectConfigurationForCommand() : mixed
- Inject configuration for command.
- injectConfigurationForGlobalOptions() : mixed
- Inject configurations for global options.
- explodeArray() : array<string|int, mixed>
- Explode a string to array.
- isArray() : bool
- Check whether the option is marked as VALUE_IS_ARRAY.
Properties
$application
The application.
protected
Application
$application
$config
The config.
protected
ConfigInterface
$config
Methods
__construct()
Construct new ConfigForCommand.
public
__construct(ConfigInterface $config) : mixed
Parameters
- $config : ConfigInterface
-
The configuration.
Return values
mixed —getSubscribedEvents()
{@inheritdoc}
public
static getSubscribedEvents() : mixed
Return values
mixed —injectConfiguration()
Before a Console command runs, inject configuration settings for this command into the default value of the options of this command.
public
injectConfiguration(ConsoleCommandEvent $event) : mixed
Parameters
- $event : ConsoleCommandEvent
-
The current event.
Return values
mixed —setApplication()
Set application.
public
setApplication(Application $application) : mixed
Parameters
- $application : Application
-
The application.
Return values
mixed —fixInputForSymfony2()
Fix arguments for help command.
protected
fixInputForSymfony2(Command $command, InputInterface $input) : mixed
Parameters
- $command : Command
-
The command.
- $input : InputInterface
-
The input.
Return values
mixed —getHelpCommandTarget()
Get the help command.
protected
getHelpCommandTarget(Command $command, InputInterface $input) : false|Command
Parameters
- $command : Command
-
The command to get the help from.
- $input : InputInterface
-
The current input.
Return values
false|Command —The command.
injectConfigGroupIntoOptions()
Inject configurations for options.
protected
injectConfigGroupIntoOptions(ConfigGroup $configGroup, array<string|int, mixed> $options, InputInterface $input) : mixed
Parameters
- $configGroup : ConfigGroup
-
The current config group.
- $options : array<string|int, mixed>
-
The options.
- $input : InputInterface
-
The input.
Return values
mixed —injectConfigurationForCommand()
Inject configuration for command.
protected
injectConfigurationForCommand(Command $command, InputInterface $input) : mixed
Parameters
- $command : Command
-
The command to configure.
- $input : InputInterface
-
The current input.
Return values
mixed —injectConfigurationForGlobalOptions()
Inject configurations for global options.
protected
injectConfigurationForGlobalOptions(InputInterface $input) : mixed
Parameters
- $input : InputInterface
-
The current input.
Return values
mixed —explodeArray()
Explode a string to array.
private
explodeArray(mixed $value) : array<string|int, mixed>
Parameters
- $value : mixed
-
The value to explode.
Return values
array<string|int, mixed> —The exploded values.
isArray()
Check whether the option is marked as VALUE_IS_ARRAY.
private
isArray( $inputOption) : bool
Parameters
Return values
bool —Whether is an array or not.