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

Consider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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