| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 1 | public function __unserialize(array $data): void |
|
| 37 | { |
||
| 38 | 1 | $doc = DomUtil::createDocument(); |
|
| 39 | 1 | if (false === $doc->loadXML($data['svg'])) { |
|
| 40 | throw new ParseException(sprintf('Unable to load SVG string "%s".', func_get_arg(0))); // @codeCoverageIgnore |
||
| 41 | } |
||
| 42 | |||
| 43 | // Get first svg item |
||
| 44 | 1 | $node = $doc->getElementsByTagName('svg')->item(0); |
|
| 45 | assert($node instanceof \DOMElement); |
||
| 46 | |||
| 47 | 1 | $this->svg = $node; |
|
| 48 | } |
||
| 50 |