Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | abstract class Parse implements ParseInterface |
||
17 | { |
||
18 | use Options; |
||
19 | |||
20 | private ?string $configSource = null; |
||
21 | protected LoggerInterface $logger; |
||
22 | |||
23 | 17 | public function __construct() |
|
24 | { |
||
25 | 17 | $this->logger = new NullLogger(); |
|
26 | 17 | } |
|
27 | |||
28 | 10 | public function setLogger(LoggerInterface $logger) |
|
29 | { |
||
30 | 10 | $this->logger = $logger; |
|
31 | 10 | } |
|
32 | |||
33 | 17 | public function addConfigSource(string $source): void |
|
34 | { |
||
35 | 17 | $this->configSource = $source; |
|
36 | 17 | } |
|
37 | |||
38 | 17 | public function parse() |
|
50 | } |
||
51 | |||
52 | |||
53 | |||
54 | // protected function setError(string $error): void |
||
55 | // { |
||
56 | // $this->errors[] = $error; |
||
57 | // } |
||
58 | |||
59 | // public function getErrors(): ?array |
||
60 | // { |
||
61 | // return $this->errors; |
||
62 | // } |
||
63 | |||
64 | /** |
||
65 | * @param string $string |
||
66 | * @return mixed |
||
67 | */ |
||
68 | abstract protected function parseString(string $string); |
||
69 | |||
70 | /** |
||
71 | * @param string $filename |
||
72 | * @return mixed |
||
73 | */ |
||
74 | abstract protected function parseFile(string $filename); |
||
75 | } |
||
76 |