Total Complexity | 7 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
14 | abstract class AbstractXMLResource |
||
15 | { |
||
16 | private ?XMLReader $xml = null; |
||
17 | |||
18 | public function __construct(private readonly string $path) |
||
19 | { |
||
20 | } |
||
21 | |||
22 | public function __destruct() |
||
23 | { |
||
24 | $this->closeXMLReader(); |
||
25 | } |
||
26 | |||
27 | protected function getXMLReader(): XMLReader |
||
30 | } |
||
31 | |||
32 | protected function createXMLReader(): XMLReader |
||
33 | { |
||
34 | return $this->validateXMLReader(xml: new XMLReader()); |
||
35 | } |
||
36 | |||
37 | protected function closeXMLReader(): void |
||
38 | { |
||
39 | $this->xml?->close(); |
||
40 | $this->xml = null; |
||
41 | } |
||
42 | |||
43 | private function validateXMLReader(XMLReader $xml): XMLReader |
||
52 | } |
||
53 | } |
||
54 |