Failed Conditions
Pull Request — master (#95)
by Keoghan
08:17 queued 03:39
created

EventSubscriber   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 84.21%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 12
c 1
b 0
f 0
dl 0
loc 43
ccs 16
cts 19
cp 0.8421
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A siteSecured() 0 4 2
A __construct() 0 3 1
A siteUnsecured() 0 4 2
A siteRemoved() 0 4 2
A subscribe() 0 5 1
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 193
    public function __construct(Valet $valet)
15
    {
16 193
        $this->valet = $valet;
17 193
    }
18
19 2
    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 2
        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 2
    }
25
26 2
    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 2
        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 2
    }
32
33 1
    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 1
        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 1
    }
39
40
    /**
41
     * Register the listeners for the subscriber.
42
     *
43
     * @param \Illuminate\Events\Dispatcher $events
44
     *
45
     * @return void
46
     */
47 193
    public function subscribe($events)
48
    {
49 193
        $events->listen(SiteSecured::class, static::class.'@siteSecured');
50 193
        $events->listen(SiteUnsecured::class, static::class.'@siteUnsecured');
51 193
        $events->listen(SiteRemoved::class, static::class.'@siteRemoved');
52 193
    }
53
}
54