Failed Conditions
Pull Request — master (#95)
by Keoghan
07:35
created

EventSubscriber::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace App\Support\Valet;
4
5
use App\Events\SiteRemoved;
6
use App\Events\SiteSecured;
7
use App\Events\SiteUnsecured;
8
9
class EventSubscriber
10
{
11
    /** @var Valet */
12
    protected $valet;
13
14
    public function __construct(Valet $valet)
15
    {
16
        $this->valet = $valet;
17
    }
18
19
    public function siteSecured(SiteSecured $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
    public function siteSecured(/** @scrutinizer ignore-unused */ SiteSecured $event)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
    {
21
        if (setting('use_valet') === 'off') {
0 ignored issues
show
introduced by
The condition setting('use_valet') === 'off' is always false.
Loading history...
22
            return;
23
        }
24
    }
25
26
    public function siteUnsecured(SiteUnsecured $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public function siteUnsecured(/** @scrutinizer ignore-unused */ SiteUnsecured $event)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        if (setting('use_valet') === 'off') {
0 ignored issues
show
introduced by
The condition setting('use_valet') === 'off' is always false.
Loading history...
29
            return;
30
        }
31
    }
32
33
    public function siteRemoved(SiteRemoved $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

33
    public function siteRemoved(/** @scrutinizer ignore-unused */ SiteRemoved $event)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
    {
35
        if (setting('use_valet') === 'off') {
0 ignored issues
show
introduced by
The condition setting('use_valet') === 'off' is always false.
Loading history...
36
            return;
37
        }
38
    }
39
40
    /**
41
     * Register the listeners for the subscriber.
42
     *
43
     * @param \Illuminate\Events\Dispatcher $events
44
     *
45
     * @return void
46
     */
47
    public function subscribe($events)
48
    {
49
        $events->listen(SiteSecured::class, static::class.'@siteSecured');
50
        $events->listen(SiteUnsecured::class, static::class.'@siteUnsecured');
51
        $events->listen(SiteRemoved::class, static::class.'@siteRemoved');
52
    }
53
}
54