44
55namespace SimpleSAML \SAML2 \XML \md ;
66
7- use DOMElement ;
8- use SimpleSAML \Assert \Assert ;
9- use SimpleSAML \SAML2 \Assert \Assert as SAMLAssert ;
10- use SimpleSAML \XML \Exception \InvalidDOMElementException ;
7+ use SimpleSAML \SAML2 \XML \StringElementTrait ;
118use SimpleSAML \XML \SchemaValidatableElementInterface ;
129use SimpleSAML \XML \SchemaValidatableElementTrait ;
13- use SimpleSAML \XML \StringElementTrait ;
1410
1511/**
1612 * Class implementing AttributeProfile.
@@ -30,35 +26,4 @@ public function __construct(string $content)
3026 {
3127 $ this ->setContent ($ content );
3228 }
33-
34-
35- /**
36- * Validate the content of the element.
37- *
38- * @param string $content The value to go in the XML textContent
39- * @throws \Exception on failure
40- * @return void
41- */
42- protected function validateContent (string $ content ): void
43- {
44- SAMLAssert::validURI ($ content );
45- }
46-
47-
48- /**
49- * Convert XML into a AttributeProfile
50- *
51- * @param \DOMElement $xml The XML element we should load
52- * @return static
53- *
54- * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException
55- * If the qualified name of the supplied element is wrong
56- */
57- public static function fromXML (DOMElement $ xml ): static
58- {
59- Assert::same ($ xml ->localName , 'AttributeProfile ' , InvalidDOMElementException::class);
60- Assert::same ($ xml ->namespaceURI , AttributeProfile::NS , InvalidDOMElementException::class);
61-
62- return new static ($ xml ->textContent );
63- }
6429}
0 commit comments