<commit_before><?php

namespace TypiCMS\Modules\Core\Commands;

use DB;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Schema;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Question\Question;

class Database extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'typicms:database';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Set database credentials in .env file';

    /**
     * The filesystem instance.
     *
     * @var \Illuminate\Filesystem\Filesystem
     */
    protected $files;

    /**
     * Create a new key generator command.
     *
     * @param \Illuminate\Filesystem\Filesystem $files
     */
    public function __construct(Filesystem $files)
    {
        parent::__construct();

        $this->files = $files;
    }

    /**
     * Execute the console command.
     *
     * @return null
     */
    public function fire()
    {
        $contents = $this->getKeyFile();

        $dbName = $this->argument('database');
        $dbUserName = $this->ask('What is your MySQL username?', 'root');

        $question = new Question('What is your MySQL password?', '<none>');
        $question->setHidden(true)->setHiddenFallback(true);
        $dbPassword = (new SymfonyQuestionHelper())->ask($this->input, $this->output, $question);
        if ($dbPassword === '<none>') {
            $dbPassword = '';
        }

        // Update DB credentials in .env file.
        $search = [
            '/('.preg_quote('DB_DATABASE=').')(.*)/',
            '/('.preg_quote('DB_USERNAME=').')(.*)/',
            '/('.preg_quote('DB_PASSWORD=').')(.*)/',
        ];
        $replace = [
            '$1'.$dbName,
            '$1'.$dbUserName,
            '$1'.$dbPassword,<commit_msg>Changes fire() method for handle() method<commit_after><?php

namespace TypiCMS\Modules\Core\Commands;

use DB;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Schema;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Question\Question;

class Database extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'typicms:database';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Set database credentials in .env file';

    /**
     * The filesystem instance.
     *
     * @var \Illuminate\Filesystem\Filesystem
     */
    protected $files;

    /**
     * Create a new key generator command.
     *
     * @param \Illuminate\Filesystem\Filesystem $files
     */
    public function __construct(Filesystem $files)
    {
        parent::__construct();

        $this->files = $files;
    }

    /**
     * Execute the console command.
     *
     * @return null
     */
    public function handle()
    {
        $contents = $this->getKeyFile();

        $dbName = $this->argument('database');
        $dbUserName = $this->ask('What is your MySQL username?', 'root');

        $question = new Question('What is your MySQL password?', '<none>');
        $question->setHidden(true)->setHiddenFallback(true);
        $dbPassword = (new SymfonyQuestionHelper())->ask($this->input, $this->output, $question);
        if ($dbPassword === '<none>') {
            $dbPassword = '';
        }

        // Update DB credentials in .env file.
        $search = [
            '/('.preg_quote('DB_DATABASE=').')(.*)/',
            '/('.preg_quote('DB_USERNAME=').')(.*)/',
            '/('.preg_quote('DB_PASSWORD=').')(.*)/',
        ];
        $replace = [
            '$1'.$dbName,
            '$1'.$dbUserName,
            '$1'.$dbPassword,
{'fraction_non_alphanumeric': 0.15626585489599187, 'fraction_numerical': 0.0015220700152207, 'mean_word_length': 2.274916943521595, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, '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': '484817', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1155, 'n_words': 246}