Passed
Push — feature/remove-config-default-... ( a334bc )
by Chema
09:13
created

GacelaConfigItem::withDefaults()   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 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Config\GacelaFileConfig;
6
7
use Gacela\Framework\Config\ConfigReader\PhpConfigReader;
8
use Gacela\Framework\Config\ConfigReaderInterface;
9
10
final class GacelaConfigItem
11
{
12
    private string $path;
13
    private string $pathLocal;
14
    private ConfigReaderInterface $reader;
15
16 22
    public function __construct(
17
        string $path,
18
        string $pathLocal = '',
19
        ?ConfigReaderInterface $reader = null
20
    ) {
21 22
        $this->path = $path;
22 22
        $this->pathLocal = $pathLocal;
23 22
        $this->reader = $reader ?? new PhpConfigReader();
24
    }
25
26 10
    public function path(): string
27
    {
28 10
        return $this->path;
29
    }
30
31 10
    public function pathLocal(): string
32
    {
33 10
        return $this->pathLocal;
34
    }
35
36 12
    public function reader(): ConfigReaderInterface
37
    {
38 12
        return $this->reader;
39
    }
40
}
41