| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public static function fromXML(DOMElement $xml): static |
||
| 36 | { |
||
| 37 | Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); |
||
| 38 | Assert::same($xml->namespaceURI, static::getNamespaceURI(), InvalidDOMElementException::class); |
||
| 39 | |||
| 40 | $m = M::getChildrenOfClass($xml); |
||
| 41 | Assert::minCount($m, 1, MissingElementException::class); |
||
| 42 | Assert::maxCount($m, 1, TooManyElementsException::class); |
||
| 43 | |||
| 44 | return new static( |
||
| 45 | array_pop($m), |
||
| 46 | ); |
||
| 49 |