| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.432 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 150 | public function __construct(XMLDocumentInterface $dom = null) |
|
| 46 | { |
||
| 47 | 150 | if (!extension_loaded('libxml')) { |
|
| 48 | throw new \RuntimeException('The libxml extension is disabled. It is necessary to work with XML. You can try to recompile PHP with --with-libxml-dir=<location>.'); |
||
| 49 | } |
||
| 50 | 150 | if ($dom !== null) { |
|
| 51 | $this->domImpl = $dom; |
||
| 52 | } else { |
||
| 53 | 150 | if (DOMWrapper::isLoaded()) { |
|
| 54 | 150 | $this->domImpl = new DOMWrapper(); |
|
| 55 | 150 | } |
|
| 56 | } |
||
| 57 | 150 | } |
|
| 58 | |||
| 69 | } |