BlueprintCreate   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 1
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