<commit_before><?php

declare(strict_types=1);

namespace Cortex\Foundation\Console\Commands;

use Illuminate\Console\Command;

class CoreInstallCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'cortex:install {--f|force : Force the operation to run when in production.} {--r|resource=* : Specify which resources to publish.}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Install Cortex Project.';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle(): void
    {
        $this->alert($this->description);

        $this->call('key:generate', ['--ansi' => true]);
        $this->call('storage:link');

        // Publish assets only if explicitly required, otherwise skip for clean installation
        ! $this->option('resource') || $this->call('cortex:publish', ['--force' => $this->option('force'), '--resource' => $this->option('resource')]);

        $this->call('cortex:migrate', ['--force' => $this->option('force')]);
        $this->call('cortex:seed');

        $this->call('cortex:autoload', ['--force' => $this->option('force')]);
        $this->call('cortex:activate', ['--force' => $this->option('force')]);
    }
}
<commit_msg>Run self diagnosis before installation<commit_after><?php

declare(strict_types=1);

namespace Cortex\Foundation\Console\Commands;

use Illuminate\Console\Command;

class CoreInstallCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'cortex:install {--f|force : Force the operation to run when in production.} {--r|resource=* : Specify which resources to publish.}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Install Cortex Project.';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle(): void
    {
        $this->alert($this->description);

        $this->call('key:generate', ['--ansi' => true]);
        $this->call('storage:link');

        $this->call('self-diagnosis');

        // Publish assets only if explicitly required, otherwise skip for clean installation
        ! $this->option('resource') || $this->call('cortex:publish', ['--force' => $this->option('force'), '--resource' => $this->option('resource')]);

        $this->call('cortex:migrate', ['--force' => $this->option('force')]);
        $this->call('cortex:seed');

        $this->call('cortex:autoload', ['--force' => $this->option('force')]);
        $this->call('cortex:activate', ['--force' => $this->option('force')]);
    }
}

{'fraction_non_alphanumeric': 0.18425760286225404, 'fraction_numerical': 0.0007155635062611807, 'mean_word_length': 2.932489451476793, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 46, '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': '242298', 'n_tokens_mistral': 819, 'n_tokens_neox': 802, 'n_words': 187}