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

GeneratorPath   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 27
ccs 12
cts 12
cp 1
rs 10
wmc 4
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A getPath() 0 4 1
A generate() 0 4 1
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