state = $state; $this->keyValue = $keyValue; parent::__construct(); } /** * {@inheritdoc} */ protected function configure() { $this ->setName('debug:state') ->setDescription($this->trans('commands.debug.state.description')) ->addArgument( 'key', InputArgument::OPTIONAL, $this->trans('commands.debug.state.arguments.key') ) ->setHelp($this->trans('commands.debug.state.help')) ->setAliases(['dst']); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); if ($key) { $this->getIo()->info($key); $this->getIo()->writeln(Yaml::encode($this->state->get($key))); return 0; } $tableHeader = [$this->trans('commands.debug.state.messages.key')]; $keyStoreStates = array_keys($this->keyValue->get('state')->getAll()); $this->getIo()->table($tableHeader, $keyStoreStates); return 0; } }