BlueprintCreate::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Yaro\ApiDocs\Commands;
4
5
use Illuminate\Console\Command;
6
7
class BlueprintCreate extends Command
8
{
9
    protected $signature = 'apidocs:blueprint-create {name?} {--disc=} {--prefix=}';
10
11
    protected $description = 'Create a new Blueprint API file.';
12
13
    public function handle()
14
    {
15
        $apiDocs = app()->make('yaro.apidocs');
16
        $snapshotName = $apiDocs->blueprint($this->option('prefix'))
17
                                ->create(
18
                                    (string) $this->argument('name'), 
19
                                    (string) $this->option('disc')
20
                                );
21
22
        $this->info(sprintf('New blueprint snapshot [%s] created successfully.', $snapshotName));
23
    }
24
}
25