/**
* Internal function to execute the command.
*
* @param InputInterface $input The input to inject into the command.
* @param OutputInterface $output The output to inject into the command.
*
* @return integer The command exit code
*
* @since 4.0.0
*/
protected function doExecute(InputInterface $input, OutputInterface $output) : int
{
$this->configureIO($input, $output);
$configs = $this->formatConfig($this->getApplication()->getConfig()->toArray());
$option = $this->cliInput->getArgument('option');
$group = $this->cliInput->getOption('group');
if ($group) {
return $this->processGroupOptions($group);
}
if ($option) {
return $this->processSingleOption($option);
}
if (!$option && !$group) {
$options = [];
array_walk($configs, function ($value, $key) use(&$options) {
$options[] = [$key, $this->formatConfigValue($value)];
});
$this->ioStyle->title("Current options in Configuration");
$this->ioStyle->table(['Option', 'Value'], $options);
return self::CONFIG_GET_SUCCESSFUL;
}
return self::CONFIG_GET_OPTION_NOT_FOUND;
}