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.
Table of Contents
Interfaces
- EventSubscriberInterface
Properties
- $application : Application|null
- The application.
- $config : ConfigInterface
- The config.
Methods
- __construct() : mixed
- Construct new ConfigForCommand.
- getSubscribedEvents() : mixed
- {@inheritdoc}
- injectConfiguration() : mixed
- Inject configurations.
- 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|null
$application
$config
The config.
protected
ConfigInterface
$config
Methods
__construct()
Construct new ConfigForCommand.
public
__construct(ConfigInterface $config) : mixed
Parameters
- $config : ConfigInterface
-
The configuration.
getSubscribedEvents()
{@inheritdoc}
public
static getSubscribedEvents() : mixed
injectConfiguration()
Inject configurations.
public
injectConfiguration(ConsoleCommandEvent $event) : mixed
Before a Console command runs, inject configuration settings for this command into the default value of the options of this command.
Parameters
- $event : ConsoleCommandEvent
-
The current event.
setApplication()
Set application.
public
setApplication(Application $application) : mixed
Parameters
- $application : Application
-
The application.
fixInputForSymfony2()
Fix arguments for help command.
protected
fixInputForSymfony2(Command $command, InputInterface $input) : mixed
Parameters
- $command : Command
-
The command.
- $input : InputInterface
-
The input.
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.
injectConfigurationForCommand()
Inject configuration for command.
protected
injectConfigurationForCommand(Command $command, InputInterface $input) : mixed
Parameters
- $command : Command
-
The command to configure.
- $input : InputInterface
-
The current input.
injectConfigurationForGlobalOptions()
Inject configurations for global options.
protected
injectConfigurationForGlobalOptions(InputInterface $input) : mixed
Parameters
- $input : InputInterface
-
The current input.
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(mixed $inputOption) : bool
Parameters
- $inputOption : mixed
-
The option being checked.
Return values
bool —Whether is an array or not.