Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public static function fromXML(DOMElement $xml): static |
||
33 | { |
||
34 | Assert::same($xml->localName, 'AuthenticationQuery', InvalidDOMElementException::class); |
||
35 | Assert::same($xml->namespaceURI, AuthenticationQuery::NS, InvalidDOMElementException::class); |
||
36 | |||
37 | $authenticationMethod = self::getAttribute($xml, 'AuthenticationMethod'); |
||
38 | |||
39 | $subject = Subject::getChildrenOfClass($xml); |
||
40 | Assert::minCount($subject, 1, MissingElementException::class); |
||
41 | Assert::maxCount($subject, 1, TooManyElementsException::class); |
||
42 | |||
43 | return new static(array_pop($subject), $authenticationMethod); |
||
44 | } |
||
46 |