Completed
Push — master ( ea7a05...07212d )
by Raul
02:50 queued 15s
created

EmptyCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 2
c 3
b 1
f 0
lcom 1
cbo 0
dl 0
loc 43
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 4 1
1
<?php
2
3
namespace Publiux\laravelcdn\Commands;
4
5
use Illuminate\Console\Command;
6
use Publiux\laravelcdn\Contracts\CdnInterface;
7
8
/**
9
 * Class PushCommand.
10
 *
11
 * @category Command
12
 *
13
 * @author   Mahmoud Zalt <[email protected]>
14
 * @author   Raul Ruiz <[email protected]>
15
 */
16
class EmptyCommand extends Command
17
{
18
    /**
19
     * The console command name.
20
     *
21
     * @var string
22
     */
23
    protected $signature = 'cdn:empty';
24
25
    /**
26
     * The console command description.
27
     *
28
     * @var string
29
     */
30
    protected $description = 'Empty all assets from CDN';
31
32
    /**
33
     * an instance of the main Cdn class.
34
     *
35
     * @var Vinelab\Cdn\Cdn
36
     */
37
    protected $cdn;
38
39
    /**
40
     * @param CdnInterface $cdn
41
     */
42
    public function __construct(CdnInterface $cdn)
43
    {
44
        $this->cdn = $cdn;
0 ignored issues
show
Documentation Bug introduced by
It seems like $cdn of type object<Publiux\laravelcdn\Contracts\CdnInterface> is incompatible with the declared type object<Publiux\laravelcd...mmands\Vinelab\Cdn\Cdn> of property $cdn.

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...
45
46
        parent::__construct();
47
    }
48
49
    /**
50
     * Execute the console command.
51
     *
52
     * @return mixed
53
     */
54
    public function handle()
55
    {
56
        $this->cdn->emptyBucket();
57
    }
58
}
59