<commit_before><?php namespace Laracasts\Commander\Console;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Illuminate\Filesystem\Filesystem;
use Mustache_Engine;

class CommanderGenerateCommand extends Command {

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'commander:generate';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Generate a new command and handler class.';

    /**
     * @var Filesystem
     */
    protected $file;

    /**
     * @var Mustache_Engine
     */
    protected $mustache;

    /**
     * @var CommandInputParser
     */
    protected $parser;

    /**
     * @var CommandGenerator
     */
    protected $generator;

    /**
     * Create a new command instance.
     *
     * @param CommandInputParser $parser
     * @param CommandGenerator $generator
     */
    public function __construct(CommandInputParser $parser, CommandGenerator $generator)
    {
        $this->parser = $parser;
        $this->generator = $generator;

        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function fire()
    {
        // Parse the input for the Artisan command into a usable format.
        $input = $this->parser->parse(
            $this->argument('path'),
            $this->option('properties')
        );

        // Parse the input for the Artisan command into a usable format.
        $path = $this->argument('path');
        $properties = $this->option('properties');
        $base = $this->option('base');

        $commandInput = $this->parser->parse($path, $properties);
        $handlerInput = $this->parser->parse($path.'Handler', $properties);

        // Actually create the file with the correct boilerplate.
        $this->generator->make(
            $commandInput,
            __DIR__.'/stubs/command.stub',
            "{$base}/{$path}.php"
        );

        $this->generator->make(
            $handlerInput,
            __DIR__.'/stubs/handler.stub',
            "{$base}/{$path}Handler.php"
        );

        $this->info('All done! Your two classes have now been generated.');
    }

    protected function getArguments()
    {<commit_msg>Refactor artisan command<commit_after><?php namespace Laracasts\Commander\Console;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Illuminate\Filesystem\Filesystem;
use Mustache_Engine;

class CommanderGenerateCommand extends Command {

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'commander:generate';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Generate a new command and handler class.';

    /**
     * @var Filesystem
     */
    protected $file;

    /**
     * @var Mustache_Engine
     */
    protected $mustache;

    /**
     * @var CommandInputParser
     */
    protected $parser;

    /**
     * @var CommandGenerator
     */
    protected $generator;

    /**
     * Create a new command instance.
     *
     * @param CommandInputParser $parser
     * @param CommandGenerator $generator
     */
    public function __construct(CommandInputParser $parser, CommandGenerator $generator)
    {
        $this->parser = $parser;
        $this->generator = $generator;

        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function fire()
    {
        $path = $this->argument('path');
        $properties = $this->option('properties');
        $base = $this->option('base');

        // Parse the input for the Artisan command into a usable format.
        $input = $this->parser->parse($path, $properties);

        $commandInput = $this->parser->parse($path, $properties);
        $handlerInput = $this->parser->parse($path.'Handler', $properties);

        // Actually create the files with the correct boilerplate.
        $this->generator->make(
            $commandInput,
            __DIR__.'/stubs/command.stub',
            "{$base}/{$path}.php"
        );

        $this->generator->make(
            $handlerInput,
            __DIR__.'/stubs/handler.stub',
            "{$base}/{$path}Handler.php"
        );

        $this->info('All done! Your two classes have now been generated.');
    }

    protected function getArguments()
    {
{'fraction_non_alphanumeric': 0.12930474333983105, 'fraction_numerical': 0.0, 'mean_word_length': 2.180440771349862, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '4938182', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1244, 'n_words': 298}