Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
11 | 11 | public function loadString(string $doc) : Element |
|
12 | { |
||
13 | 11 | $document = new \DOMDocument(); |
|
14 | 11 | $document->registerNodeClass(\DOMElement::class, DomElement::class); |
|
15 | 11 | $loaded = $document->loadXML($doc); |
|
16 | |||
17 | 11 | Assert::true($loaded, sprintf('Unable to load the xml string "%s"', $doc)); |
|
18 | |||
19 | 11 | return $document->childNodes->item(0); |
|
20 | } |
||
21 | |||
31 |