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

GacelaConfigItem   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 29
rs 10
c 0
b 0
f 0
ccs 10
cts 10
cp 1
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A reader() 0 3 1
A __construct() 0 8 1
A pathLocal() 0 3 1
A path() 0 3 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