Conditions | 2 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
30 | 354 | protected function initContentFromContentString(string $content): AbstractDocument |
|
31 | { |
||
32 | 354 | $contentClass = $this->contentClass(); |
|
33 | 354 | $domDocument = new DOMDocument('1.0', 'utf-8'); |
|
34 | |||
35 | try { |
||
36 | 354 | $domDocument->loadXML($content, LIBXML_NOERROR); |
|
37 | 354 | $this->content = new $contentClass($domDocument, $this->generator); |
|
38 | 2 | } catch (Exception $exception) { |
|
39 | 2 | throw new InvalidArgumentException(sprintf('Unable to load document at "%s"', $this->getName()), __LINE__, $exception); |
|
40 | } |
||
41 | |||
42 | 352 | return $this; |
|
43 | } |
||
50 |