SyncProvidedRoutesCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 5 1
1
<?php
2
3
4
namespace ElementsFramework\DynamicRouting\Console;
5
6
7
use ElementsFramework\DynamicRouting\Service\Publishing\RoutePublisher;
8
use Illuminate\Console\Command;
9
10
class SyncProvidedRoutesCommand extends Command
11
{
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'dynamic-route:provided:sync';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Runs the publish and cleanup command in one go.';
25
26
    /**
27
     * The route compiler
28
     *
29
     * @var RouteDeclarationCompiler
30
     */
31
    protected $publisher;
32
33
    /**
34
     * Create a new command instance.
35
     *
36
     * @param RoutePublisher $publisher
37
     */
38
    public function __construct(RoutePublisher $publisher)
39
    {
40
        parent::__construct();
41
42
        $this->publisher = $publisher;
0 ignored issues
show
Documentation Bug introduced by
It seems like $publisher of type object<ElementsFramework...lishing\RoutePublisher> is incompatible with the declared type object<ElementsFramework...uteDeclarationCompiler> of property $publisher.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
43
    }
44
45
    /**
46
     * Execute the console command.
47
     *
48
     * @return mixed
49
     */
50
    public function handle()
51
    {
52
        $this->call('dynamic-route:provided:publish');
53
        $this->call('dynamic-route:provided:cleanup');
54
    }
55
}