<commit_before><?php

namespace Sven\ArtisanView\Commands;

use Sven\ArtisanView\View;
use Illuminate\Console\Command;

class MakeViewCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'make:view
                           {name : The name of the view to create.}
                           {--resource : Should we create a RESTful resource?}
                           {--verbs= : The verbs that should be used for the resource.}
                           {--extends= : What \'master\' view should be extended?}
                           {--sections= : A comma-separated list of sections to create.}
                           {--directory=resources/views/ : The directory where your views are stored.}
                           {--extension=blade.php : What file extension should the view have?}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new view';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        $directory = (string) $this->option('directory');

        $view = new View(base_path($directory));

        $name      = (string) $this->argument('name');
        $extension = (string) $this->option('extension');
        $extend    = (string) $this->option('extends');
        $sections  = $this->option('sections');
        $resource  = (boolean) $this->option('resource');
        $verbs     = $this->option('verbs');

        try {
            if ($resource) {
                $view->resource($name, $verbs, $extension);

                return $this->info("Resource [$name] successfully created");
            }

            $view->create($name, $extension)->extend($extend)->sections($sections);

            return $this->info("View [$name] successfully created");
        } catch (\Exception $e) {
            return $this->error($e->getMessage());
        }
    }
}<commit_msg>Edit command to include new functionality<commit_after><?php

namespace Sven\ArtisanView\Commands;

use Sven\ArtisanView\View;
use Illuminate\Console\Command;

class MakeViewCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'make:view
                           {name : The name of the view to create.}
                           {--resource : Should we create a RESTful resource?}
                           {--verbs= : The verbs that should be used for the resource.}
                           {--extends= : What \'master\' view should be extended?}
                           {--sections= : A comma-separated list of sections to create.}
                           {--directory=resources/views/ : The directory where your views are stored.}
                           {--extension=blade.php : What file extension should the view have?}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new view';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        $directory = (string) $this->option('directory');

        $view = new View(base_path($directory));

        $name      = (string) $this->argument('name');
        $extension = (string) $this->option('extension');
        $extend    = (string) $this->option('extends');
        $sections  = $this->option('sections');
        $resource  = (boolean) $this->option('resource');
        $verbs     = $this->option('verbs');

        try {
            if ($resource) {
                $view->resource($name, $verbs, $extension)
                     ->extend($extend)
                     ->sections($sections);

                return $this->info("Resource [$name] successfully created");
            }

            $view->create($name, $extension)->extend($extend)->sections($sections);

            return $this->info("View [$name] successfully created");
        } catch (\Exception $e) {
            return $this->error($e->getMessage());
        }
    }
}
{'fraction_non_alphanumeric': 0.13489037178265015, 'fraction_numerical': 0.0, 'mean_word_length': 1.790558510638298, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '2865151', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1058, 'n_words': 299}