| Total Complexity | 2 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | final class X509Certificate extends AbstractDsElement |
||
| 19 | { |
||
| 20 | use XMLStringElementTrait; |
||
| 21 | |||
| 22 | |||
| 23 | /** |
||
| 24 | * Validate the content of the element. |
||
| 25 | * |
||
| 26 | * @param string $content The value to go in the XML textContent |
||
| 27 | * @throws \Exception on failure |
||
| 28 | * @return void |
||
| 29 | */ |
||
| 30 | protected function validateContent(string $content): void |
||
| 31 | { |
||
| 32 | Assert::notEmpty($content, 'ds:X509Certificate cannot be empty'); |
||
| 33 | Assert::stringPlausibleBase64($content, 'ds:X509Certificate is not a valid Base64 encoded string'); |
||
| 34 | } |
||
| 35 | |||
| 36 | |||
| 37 | /** |
||
| 38 | * Convert XML into a X509Certificate |
||
| 39 | * |
||
| 40 | * @param \DOMElement $xml The XML element we should load |
||
| 41 | * @return self |
||
| 42 | * |
||
| 43 | * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
||
| 44 | * If the qualified name of the supplied element is wrong |
||
| 45 | */ |
||
| 46 | public static function fromXML(DOMElement $xml): object |
||
| 52 | } |
||
| 53 | } |
||
| 54 |