<commit_before><?php

/**
 * @file
 * Contains \Drupal\Console\Command\State\OverrideCommand.
 */

namespace Drupal\Console\Command\State;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Drupal\Console\Command\ContainerAwareCommand;
use Drupal\Console\Style\DrupalStyle;
use Drupal\Component\Serialization\Yaml;

/**
 * Class DebugCommand
 * @package Drupal\Console\Command\State
 */
class OverrideCommand extends ContainerAwareCommand
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('state:override')
            ->setDescription($this->trans('commands.state.override.description'))
            ->addArgument(
                'key',
                InputArgument::OPTIONAL,
                $this->trans('commands.state.override.arguments.key')
            )
            ->addArgument(
                'value',
                InputArgument::OPTIONAL,
                $this->trans('commands.state.override.arguments.value')
            );
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new DrupalStyle($input, $output);
        $key = $input->getArgument('key');
        $value = $input->getArgument('value');

        if (!$key) {
            $io->error($this->trans('commands.state.override.errors.no-key'));
        }
<commit_msg>Adding interation into the state override command.<commit_after><?php

/**
 * @file
 * Contains \Drupal\Console\Command\State\OverrideCommand.
 */

namespace Drupal\Console\Command\State;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Drupal\Console\Command\ContainerAwareCommand;
use Drupal\Console\Style\DrupalStyle;
use Drupal\Component\Serialization\Yaml;

/**
 * Class DebugCommand
 * @package Drupal\Console\Command\State
 */
class OverrideCommand extends ContainerAwareCommand
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('state:override')
            ->setDescription($this->trans('commands.state.override.description'))
            ->addArgument(
                'key',
                InputArgument::OPTIONAL,
                $this->trans('commands.state.override.arguments.key')
            )
            ->addArgument(
                'value',
                InputArgument::OPTIONAL,
                $this->trans('commands.state.override.arguments.value')
            );
    }
    /**
     * {@inheritdoc}
     */
    protected function interact(InputInterface $input, OutputInterface $output)
    {
        $io = new DrupalStyle($input, $output);
        $key = $input->getArgument('key');
        $value = $input->getArgument('value');

        if (!$key) {
            $keyValue = $this->getService('keyvalue');
            $names = array_keys($keyValue->get('state')->getAll());
            $key = $io->choiceNoList(
                $this->trans('commands.state.override.arguments.key'),
                $names
            );
            $input->setArgument('key', $key);
        }
        if (!$value) {
            $value = $io->ask(
                $this->trans('commands.state.override.arguments.value')
            );
            $input->setArgument('value', $value);
        }
    }
    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new DrupalStyle($input, $output);
        $key = $input->getArgument('key');
        $value = $input->getArgument('value');

        if (!$key) {
            $io->error($this->trans('commands.state.override.errors.no-key'));
        }

{'fraction_non_alphanumeric': 0.1437790397521941, 'fraction_numerical': 0.0, 'mean_word_length': 2.264532434709351, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3208373', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1051, 'n_words': 158}