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

EmptyCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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