| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 1 | public function __unserialize(array $data): void |
|
| 47 | { |
||
| 48 | 1 | $doc = DomUtil::createDocument(); |
|
| 49 | 1 | if (false === $doc->loadXML($data['svg'])) { |
|
| 50 | throw new ParseException(sprintf('Unable to load SVG string "%s".', func_get_arg(0))); // @codeCoverageIgnore |
||
| 51 | } |
||
| 52 | |||
| 53 | // Get first svg item |
||
| 54 | 1 | $node = $doc->getElementsByTagName('svg')->item(0); |
|
| 55 | assert($node instanceof \DOMElement); |
||
| 56 | |||
| 57 | 1 | $this->svg = $node; |
|
| 58 | } |
||
| 60 |