Passed
Push — master ( 949697...536316 )
by Mike
03:12
created

Publish   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 20
c 1
b 1
f 0
dl 0
loc 32
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 27 5
1
<?php namespace GeneaLabs\LaravelModelCaching\Console\Commands;
2
3
use GeneaLabs\LaravelModelCaching\Providers\Service;
4
use Illuminate\Console\Command;
5
6
class Publish extends Command
7
{
8
    protected $signature = 'modelCache:publish {--assets} {--config} {--views} {--migrations}';
9
    protected $description = "Publish various assets of the 'Model Caching for Laravel' package.";
10
11
    public function handle()
12
    {
13
        if ($this->option('assets')) {
14
            $this->call('casts:publish', ['--assets' => true]);
15
        }
16
17
        if ($this->option('config')) {
18
            $this->call('vendor:publish', [
19
                '--provider' => Service::class,
20
                '--tag' => ['config'],
21
                '--force' => true,
22
            ]);
23
        }
24
25
        if ($this->option('views')) {
26
            $this->call('vendor:publish', [
27
                '--provider' => Service::class,
28
                '--tag' => ['views'],
29
                '--force' => true,
30
            ]);
31
        }
32
33
        if ($this->option('migrations')) {
34
            $this->call('vendor:publish', [
35
                '--provider' => Service::class,
36
                '--tag' => ['migrations'],
37
                '--force' => true,
38
            ]);
39
        }
40
    }
41
}
42