| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public static function fromXML(DOMElement $xml): object |
||
| 33 | { |
||
| 34 | Assert::eq( |
||
| 35 | $xml->namespaceURI, |
||
| 36 | self::NS, |
||
| 37 | 'Unknown namespace \'' . strval($xml->namespaceURI) . '\' for Extensions element.' |
||
| 38 | ); |
||
| 39 | Assert::eq( |
||
| 40 | $xml->localName, |
||
| 41 | static::getClassName(static::class), |
||
| 42 | 'Invalid Extensions element \'' . $xml->localName . '\'' |
||
| 43 | ); |
||
| 44 | $ret = []; |
||
| 45 | |||
| 46 | /** @var \DOMElement $node */ |
||
| 47 | foreach (Utils::xpQuery($xml, './*') as $node) { |
||
| 48 | $ret[] = new Chunk($node); |
||
| 49 | } |
||
| 50 | |||
| 51 | return new self($ret); |
||
|
|
|||
| 52 | } |
||
| 54 |