| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | abstract class AbstractEmptyType extends AbstractSpElement |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * AbstractEmptyType constructor. |
||
| 22 | */ |
||
| 23 | final public function __construct() |
||
| 24 | { |
||
| 25 | } |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * Initialize an EmptyType. |
||
| 30 | * |
||
| 31 | * Note: this method cannot be used when extending this class, if the constructor has a different signature. |
||
| 32 | * |
||
| 33 | * @param \DOMElement $xml The XML element we should load. |
||
| 34 | * @return static |
||
| 35 | * |
||
| 36 | * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
||
| 37 | * if the qualified name of the supplied element is wrong |
||
| 38 | */ |
||
| 39 | public static function fromXML(DOMElement $xml): static |
||
| 40 | { |
||
| 41 | $qualifiedName = static::getClassName(static::class); |
||
| 42 | Assert::eq( |
||
| 43 | $xml->localName, |
||
| 44 | $qualifiedName, |
||
| 45 | sprintf('Unexpected name for EmptyType: %s. Expected: %s.', $xml->localName, $qualifiedName), |
||
| 46 | InvalidDOMElementException::class, |
||
| 47 | ); |
||
| 48 | |||
| 49 | |||
| 50 | return new static(); |
||
| 51 | } |
||
| 52 | |||
| 53 | |||
| 54 | /** |
||
| 55 | * Convert this element to XML. |
||
| 56 | * |
||
| 57 | * @param \DOMElement|null $parent The element we should append this element to. |
||
| 58 | * @return \DOMElement |
||
| 59 | */ |
||
| 60 | public function toXML(?DOMElement $parent = null): DOMElement |
||
| 63 | } |
||
| 64 | } |
||
| 65 |