<commit_before><?php

namespace Studio\Console;

use Studio\Package;
use Studio\Config\Config;
use Studio\Shell\Shell;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Filesystem\Filesystem;

class ScrapCommand extends BaseCommand
{

    protected $config;


    public function __construct(Config $config)
    {
        parent::__construct();

        $this->config = $config;
    }

    protected function configure()
    {
        $this
            ->setName('scrap')
            ->setDescription('Delete a previously created package skeleton')
            ->addArgument(
                'path',
                InputArgument::REQUIRED,
                'The path where the package resides'
            );
    }

    protected function fire()
    {
        $path = $this->input->getArgument('path');

        if ($this->abortDeletion($path)) {
            $this->output->note('Aborted.');
            return;
        }

        $package = Package::fromFolder($path);
        $this->config->removePackage($package);

        $this->output->note('Removing package...');
        $filesystem = new Filesystem;
        $filesystem->remove($path);
        $this->output->success('Package successfully removed.');

        $this->output->note('Dumping autoloads...');
        Shell::run('composer dump-autoload');
        $this->output->success('Autoloads successfully generated.');
    }

    protected function abortDeletion($path)
    {
        return ! $this->output->confirm(
            "<question>Do you really want to scrap the package at $path?</question> ",
            false
        );
    }

}<commit_msg>Add a big, fat warning message that scrap will delete the entire folder.<commit_after><?php

namespace Studio\Console;

use Studio\Package;
use Studio\Config\Config;
use Studio\Shell\Shell;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Filesystem\Filesystem;

class ScrapCommand extends BaseCommand
{

    protected $config;


    public function __construct(Config $config)
    {
        parent::__construct();

        $this->config = $config;
    }

    protected function configure()
    {
        $this
            ->setName('scrap')
            ->setDescription('Delete a previously created package skeleton')
            ->addArgument(
                'path',
                InputArgument::REQUIRED,
                'The path where the package resides'
            );
    }

    protected function fire()
    {
        $path = $this->input->getArgument('path');

        if ($this->abortDeletion($path)) {
            $this->output->note('Aborted.');
            return;
        }

        $package = Package::fromFolder($path);
        $this->config->removePackage($package);

        $this->output->note('Removing package...');
        $filesystem = new Filesystem;
        $filesystem->remove($path);
        $this->output->success('Package successfully removed.');

        $this->output->note('Dumping autoloads...');
        Shell::run('composer dump-autoload');
        $this->output->success('Autoloads successfully generated.');
    }

    protected function abortDeletion($path)
    {
        $this->output->caution("This will delete the entire $path folder and all files within.");

        return ! $this->output->confirm(
            "<question>Do you really want to scrap the package at $path?</question> ",
            false
        );
    }

}
{'fraction_non_alphanumeric': 0.13177842565597667, 'fraction_numerical': 0.0, 'mean_word_length': 2.2958693563880885, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 53, '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': '333692', 'n_tokens_mistral': 919, 'n_tokens_neox': 891, 'n_words': 203}