Passed
Push — master ( f4581e...bd39dd )
by Mike
02:39
created

Publish   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 39.47 %

Importance

Changes 0
Metric Value
dl 15
loc 38
rs 10
c 0
b 0
f 0
wmc 7

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php namespace GeneaLabs\LaravelMessenger\Console\Commands;
2
3
use Illuminate\Console\Command;
4
use Illuminate\Contracts\Console\Kernel;
5
use GeneaLabs\LaravelMessenger\Providers\Service;
6
7
class Publish extends Command
8
{
9
    protected $signature = 'messenger:publish {--config}';
10
    protected $description = 'Publish configuration file of the Laravel Messenger package.';
11
12
    public function handle()
13
    {
14
        if ($this->option('config')) {
15
            $this->call('vendor:publish', [
16
                '--provider' => Service::class,
17
                '--tag' => ['config'],
18
                '--force' => true,
19
            ]);
20
        }
21
    }
22
}
23