Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class GeneratorPath |
||
6 | { |
||
7 | /** @var bool */ |
||
8 | private $generate; |
||
9 | |||
10 | /** @var string */ |
||
11 | private $path; |
||
12 | |||
13 | /** @var string */ |
||
14 | private $namespace; |
||
15 | |||
16 | /** |
||
17 | * @param array|string $config |
||
18 | */ |
||
19 | public function __construct($config) |
||
20 | { |
||
21 | if (is_array($config)) { |
||
22 | $this->path = $config['path']; |
||
23 | $this->generate = $config['generate']; |
||
24 | $this->namespace = $config['namespace'] ?? $config['path']; |
||
25 | |||
26 | return; |
||
27 | } |
||
28 | |||
29 | $this->path = $config; |
||
30 | $this->generate = (bool) $config; |
||
31 | $this->namespace = $config; |
||
32 | } |
||
33 | |||
34 | public function generate(): bool |
||
35 | { |
||
36 | return $this->generate; |
||
37 | } |
||
38 | |||
39 | public function getNamespace(): string |
||
42 | } |
||
43 | |||
44 | public function getPath(): string |
||
47 | } |
||
48 | } |
||
49 |