PublishCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace TopviewDigital\LangSwitcher\Console;
4
5
use Illuminate\Console\Command;
6
7
class PublishCommand extends Command
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $signature = 'lang-switch:publish {--force}';
15
    /**
16
     * The console command description.
17
     *
18
     * @var string
19
     */
20
    protected $description = "publish translation helper's assets, configuration, config and migration files. If you want overwrite the existing files, you can add the `--force` option";
21
22
    /**
23
     * Execute the console command.
24
     *
25
     * @return void
26
     */
27
    public function handle()
28
    {
29
        $force = $this->option('force');
30
        $options = ['--provider' => 'TopviewDigital\LangSwitcher\LangSwitcherServiceProvider'];
31
        if ($force == true) {
0 ignored issues
show
Bug Best Practice introduced by
It seems like you are loosely comparing $force of type string to the boolean true. If you are specifically checking for a non-empty string, consider using the more explicit !== '' instead.
Loading history...
32
            $options['--force'] = true;
33
        }
34
        $this->call('vendor:publish', $options);
35
    }
36
}
37