<commit_before><?php

namespace SyntaxErro\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
use SyntaxErro\Exception\CannotWriteException;
use SyntaxErro\Exception\FileNotFoundException;
use SyntaxErro\Tools\AnswerStorage;
use SyntaxErro\Tools\Twig;

class HttpAdd extends Command
{
    use Twig;
    use AnswerStorage;

    /**
     * Configure h:h command.
     * @void
     */
    protected function configure()
    {
        $this
            ->setName('http:add')
            ->setDescription('Create new apache2.4 org nginx vhost.')
            ->addArgument(
                'domain',
                InputArgument::REQUIRED,
                'Domain or address of server.'
            )
            ->addOption(
                'ssl',
                's',
                InputOption::VALUE_NONE,
                'Create vhost with SSL protocol.'
            )
            ->addOption(
                'nginx',
                'x',
                InputOption::VALUE_NONE,
                'Use nginx config output format.'
            );
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @return int|null null or 0 if everything went fine, or an error code
     *
     * @throws CannotWriteException
     * @throws FileNotFoundException
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {

        $questioner = $this->getHelper('question');
        /* Get parameters from user. */
        $domain = $input->getArgument('domain');
        $ssl = $input->getOption('ssl');
        $nginx = $input->getOption('nginx');
        $projects = $this->ask($input, $output, "What's path to directory with your all projects?", 'projects');
        $vhosts = $this->ask($input, $output, "What's path to directory with your all virtual hosts?", 'vhosts');
        $web = $this->ask($input, $output, "What's your web directory? Type '0' for DocumentRoot.", 'webDirectory');
        $email = $this->ask($input, $output, "What's your email?", 'adminEmail');

        /* Validate paths to projects and vhosts. */
        $projects = $this->validateDirectoryPath($projects);<commit_msg>change naming strategy of parameters keys<commit_after><?php

namespace SyntaxErro\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
use SyntaxErro\Exception\CannotWriteException;
use SyntaxErro\Exception\FileNotFoundException;
use SyntaxErro\Tools\AnswerStorage;
use SyntaxErro\Tools\Twig;

class HttpAdd extends Command
{
    use Twig;
    use AnswerStorage;

    /**
     * Configure h:h command.
     * @void
     */
    protected function configure()
    {
        $this
            ->setName('http:add')
            ->setDescription('Create new apache2.4 org nginx vhost.')
            ->addArgument(
                'domain',
                InputArgument::REQUIRED,
                'Domain or address of server.'
            )
            ->addOption(
                'ssl',
                's',
                InputOption::VALUE_NONE,
                'Create vhost with SSL protocol.'
            )
            ->addOption(
                'nginx',
                'x',
                InputOption::VALUE_NONE,
                'Use nginx config output format.'
            );
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @return int|null null or 0 if everything went fine, or an error code
     *
     * @throws CannotWriteException
     * @throws FileNotFoundException
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {

        $questioner = $this->getHelper('question');
        /* Get parameters from user. */
        $domain = $input->getArgument('domain');
        $ssl = $input->getOption('ssl');
        $nginx = $input->getOption('nginx');
        $projects = $this->ask($input, $output, "What's path to directory with your all projects?", 'projects');
        $vhosts = $this->ask($input, $output, "What's path to directory with your all virtual hosts?", 'vhosts');
        $web = $this->ask($input, $output, "What's your web directory? Type '0' for DocumentRoot.", 'web_directory');
        $email = $this->ask($input, $output, "What's your email?", 'admin_email');

        /* Validate paths to projects and vhosts. */
        $projects = $this->validateDirectoryPath($projects);
{'fraction_non_alphanumeric': 0.11870503597122302, 'fraction_numerical': 0.0015987210231814548, 'mean_word_length': 2.4280821917808217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '6182332', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1321, 'n_words': 338}