| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | final class OneTimeUse extends AbstractConditionType implements SchemaValidatableElementInterface |
||
| 19 | { |
||
| 20 | use SchemaValidatableElementTrait; |
||
| 21 | |||
| 22 | |||
| 23 | /** |
||
| 24 | * Convert XML into an OneTimeUse |
||
| 25 | * |
||
| 26 | * @param \DOMElement $xml The XML element we should load |
||
| 27 | * @return static |
||
| 28 | * |
||
| 29 | * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
||
| 30 | * If the qualified name of the supplied element is wrong |
||
| 31 | */ |
||
| 32 | public static function fromXML(DOMElement $xml): static |
||
| 33 | { |
||
| 34 | Assert::same($xml->localName, 'OneTimeUse', InvalidDOMElementException::class); |
||
| 35 | Assert::same($xml->namespaceURI, OneTimeUse::NS, InvalidDOMElementException::class); |
||
| 36 | |||
| 37 | return new static(); |
||
| 38 | } |
||
| 39 | |||
| 40 | |||
| 41 | /** |
||
| 42 | * Convert this OneTimeUse to XML. |
||
| 43 | * |
||
| 44 | * @param \DOMElement $parent The element we are converting to XML. |
||
| 45 | * @return \DOMElement The XML element after adding the data corresponding to this OneTimeUse. |
||
| 46 | */ |
||
| 47 | public function toXML(?DOMElement $parent = null): DOMElement |
||
| 50 | } |
||
| 51 | } |
||
| 52 |