5 * Contains \Drupal\Console\Core\Command\Settings\DebugCommand.
8 namespace Drupal\Console\Core\Command\Settings;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Console\Command\Command;
13 use Drupal\Console\Core\Command\Shared\CommandTrait;
14 use Drupal\Console\Core\Utils\ConfigurationManager;
15 use Drupal\Console\Core\Utils\NestedArray;
16 use Drupal\Console\Core\Style\DrupalStyle;
21 * @package Drupal\Console\Core\Command\Settings
23 class DebugCommand extends Command
28 * @var ConfigurationManager
30 protected $configurationManager;
35 protected $nestedArray;
38 * CheckCommand constructor.
40 * @param ConfigurationManager $configurationManager
41 * @param NestedArray $nestedArray
43 public function __construct(
44 ConfigurationManager $configurationManager,
45 NestedArray $nestedArray
47 $this->configurationManager = $configurationManager;
48 $this->nestedArray = $nestedArray;
49 parent::__construct();
55 protected function configure()
58 ->setName('settings:debug')
59 ->setDescription($this->trans('commands.settings.debug.description'));
65 protected function execute(InputInterface $input, OutputInterface $output)
67 $io = new DrupalStyle($input, $output);
69 $configuration = $this->configurationManager->getConfiguration();
70 $configApplication = $configuration->get('application');
72 unset($configApplication['autowire']);
73 unset($configApplication['languages']);
74 unset($configApplication['aliases']);
75 unset($configApplication['composer']);
76 unset($configApplication['default']['commands']);
78 $configApplicationFlatten = [];
81 $this->nestedArray->yamlFlattenArray(
83 $configApplicationFlatten,
88 $this->trans('commands.settings.debug.messages.config-key'),
89 $this->trans('commands.settings.debug.messages.config-value'),
93 foreach ($configApplicationFlatten as $ymlKey => $ymlValue) {
104 $this->trans('commands.settings.debug.messages.config-file')
111 '%s/.console/config.yml',
112 $this->configurationManager->getHomeDirectory()
119 $io->table($tableHeader, $tableRows, 'compact');