Install   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 17 2
1
<?php
2
3
namespace Mtolhuys\LaravelSchematics\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Artisan;
7
8
class Install extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'schematics:install';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Installs laravel-schematics package';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     * @throws \Exception
29
     */
30
    public function handle()
31
    {
32
        try {
33
            Artisan::call('route:cache');
34
        } catch (\LogicException $e) {
35
            $this->warn('Routes couldn\'t be cached because of Closure.');
36
            $this->error($e->getMessage());
37
        }
38
39
        Artisan::call('vendor:publish', [
40
            '--provider' => 'Mtolhuys\LaravelSchematics\LaravelSchematicsServiceProvider',
41
            '--force' => true,
42
        ]);
43
44
45
        $this->comment(Artisan::output());
46
    }
47
}
48