Completed
Push — master ( 70a113...5db400 )
by Nicolas
02:54
created

GeneratorPath::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 7
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 11
ccs 8
cts 8
cp 1
crap 2
rs 9.4285
1
<?php
2
3
namespace Nwidart\Modules\Support\Config;
4
5
class GeneratorPath
6
{
7
    private $path;
8
    private $generate;
9
10 79
    public function __construct($config)
11
    {
12 79
        if (is_array($config)) {
13 76
            $this->path = $config['path'];
14 76
            $this->generate = $config['generate'];
15
16 76
            return;
17
        }
18 5
        $this->path = $config;
19 5
        $this->generate = (bool) $config;
20 5
    }
21
22 79
    public function getPath()
23
    {
24 79
        return $this->path;
25
    }
26
27 79
    public function generate() : bool
28
    {
29 79
        return $this->generate;
30
    }
31
}
32