PublishCommand::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 13
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 19
rs 9.8333
1
<?php
2
3
namespace Uccello\Core\Console\Commands;
4
5
use Illuminate\Console\Command;
6
7
class PublishCommand extends Command
8
{
9
    /**
10
     * The name and signature of the console command.
11
     *
12
     * @var string
13
     */
14
    protected $signature = 'uccello:publish {--force : Overwrite any existing files} {--views : Publish Uccello views}';
15
16
    /**
17
     * The console command description.
18
     *
19
     * @var string
20
     */
21
    protected $description = 'Publish all of the Uccello resources';
22
23
    /**
24
     * Execute the console command.
25
     *
26
     * @return void
27
     */
28
    public function handle()
29
    {
30
        $this->comment('Publishing Uccello Assets...');
31
        $this->call('vendor:publish', [
32
            '--tag' => 'uccello-assets',
33
            '--force' => true,
34
        ]);
35
36
        $this->comment('Publishing Uccello Configuration...');
37
        $this->call('vendor:publish', [
38
            '--tag' => 'uccello-config',
39
            '--force' => $this->option('force'),
40
        ]);
41
42
        if ($this->option('views') === true) {
0 ignored issues
show
introduced by
The condition $this->option('views') === true is always false.
Loading history...
43
            $this->comment('Publishing Uccello Views...');
44
            $this->call('vendor:publish', [
45
                '--tag' => 'uccello-views',
46
                '--force' => $this->option('force'),
47
            ]);
48
        }
49
    }
50
}