Completed
Push — master ( 095584...b95a45 )
by Iman
04:31
created

Consider   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 38
ccs 15
cts 18
cp 0.8333
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A viewChecks() 0 3 1
A routeChecks() 0 3 1
A __construct() 0 3 1
A eventChecks() 0 3 1
A ignore() 0 6 1
A eloquentChecks() 0 3 1
1
<?php
2
3
namespace Imanghafoori\HeyMan;
4
5
class Consider
6
{
7
    private $mode;
8
9 11
    public function __construct($mode)
10
    {
11 11
        $this->mode = $mode;
12 11
    }
13
14 1
    public function eloquentChecks()
15
    {
16 1
        $this->ignore('heyman_ignore_eloquent');
17 1
    }
18
19 1
    public function viewChecks()
20
    {
21 1
        $this->ignore('heyman_ignore_view');
22 1
    }
23
24 9
    public function routeChecks()
25
    {
26 9
        $this->ignore('heyman_ignore_route');
27 9
    }
28
29
    public function eventChecks()
30
    {
31
        $this->ignore('heyman_ignore_event');
32
    }
33
34
    /**
35
     * @param $key
36
     */
37 11
    private function ignore($key)
38
    {
39 11
        config()->set($key, [
40
            'turnOff' => true,
41
            'turnOn' => false,
42 11
        ][$this->mode]);
43 11
    }
44
}
45