File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace SimpleSAML \WebServices \SecurityPolicy \XML \sp_200507 \Type ;
6+
7+ use DOMNodeList ;
8+ use DOMXpath ;
9+ use SimpleSAML \Assert \Assert ;
10+ use SimpleSAML \XML \DOMDocumentFactory ;
11+ use SimpleSAML \XMLSchema \Type \StringValue ;
12+
13+ /**
14+ * @package simplesaml/xml-ws-security-policy
15+ */
16+ class XPathValue extends StringValue
17+ {
18+ /**
19+ * Validate the content of the element.
20+ *
21+ * @throws \SimpleSAML\Assert\AssertionFailedException on failure
22+ */
23+ protected function validateValue (string $ content ): void
24+ {
25+ $ dom = new DOMXPath (DOMDocumentFactory::create ());
26+ $ result = $ dom ->evaluate ($ content );
27+ Assert::isInstanceOf ($ result , DOMNodeList::class);
28+ }
29+ }
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \WebServices \SecurityPolicy \XML \sp_200507 ;
66
7- use DOMNodeList ;
8- use DOMXPath ;
9- use SimpleSAML \WebServices \SecurityPolicy \Assert \Assert ;
10- use SimpleSAML \XML \DOMDocumentFactory ;
7+ use SimpleSAML \WebServices \SecurityPolicy \XML \sp_200507 \Type \XPathValue ;
118use SimpleSAML \XML \TypedTextContentTrait ;
12- use SimpleSAML \XMLSchema \Type \StringValue ;
139
1410/**
1511 * An XPath element
@@ -21,18 +17,5 @@ final class XPath extends AbstractSpElement
2117 use TypedTextContentTrait;
2218
2319
24- public const string TEXTCONTENT_TYPE = StringValue::class;
25-
26-
27- /**
28- * Validate the content of the element.
29- *
30- * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure
31- */
32- protected function validateContent (string $ content ): void
33- {
34- $ dom = new DOMXPath (DOMDocumentFactory::create ());
35- $ result = $ dom ->evaluate ($ content );
36- Assert::isInstanceOf ($ result , DOMNodeList::class);
37- }
20+ public const string TEXTCONTENT_TYPE = XPathValue::class;
3821}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace SimpleSAML \WebServices \SecurityPolicy \XML \sp_200702 \Type ;
6+
7+ use DOMNodeList ;
8+ use DOMXpath ;
9+ use SimpleSAML \Assert \Assert ;
10+ use SimpleSAML \XML \DOMDocumentFactory ;
11+ use SimpleSAML \XMLSchema \Type \StringValue ;
12+
13+ /**
14+ * @package simplesaml/xml-ws-security-policy
15+ */
16+ class XPathValue extends StringValue
17+ {
18+ /**
19+ * Validate the content of the element.
20+ *
21+ * @throws \SimpleSAML\Assert\AssertionFailedException on failure
22+ */
23+ protected function validateValue (string $ content ): void
24+ {
25+ $ dom = new DOMXPath (DOMDocumentFactory::create ());
26+ $ result = $ dom ->evaluate ($ content );
27+ Assert::isInstanceOf ($ result , DOMNodeList::class);
28+ }
29+ }
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \WebServices \SecurityPolicy \XML \sp_200702 ;
66
7- use DOMNodeList ;
8- use DOMXPath ;
9- use SimpleSAML \WebServices \SecurityPolicy \Assert \Assert ;
10- use SimpleSAML \XML \DOMDocumentFactory ;
7+ use SimpleSAML \WebServices \SecurityPolicy \XML \sp_200702 \Type \XPathValue ;
118use SimpleSAML \XML \TypedTextContentTrait ;
12- use SimpleSAML \XMLSchema \Type \StringValue ;
139
1410/**
1511 * An XPath element
@@ -21,18 +17,5 @@ final class XPath extends AbstractSpElement
2117 use TypedTextContentTrait;
2218
2319
24- public const string TEXTCONTENT_TYPE = StringValue::class;
25-
26-
27- /**
28- * Validate the content of the element.
29- *
30- * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure
31- */
32- protected function validateContent (string $ content ): void
33- {
34- $ dom = new DOMXPath (DOMDocumentFactory::create ());
35- $ result = $ dom ->evaluate ($ content );
36- Assert::isInstanceOf ($ result , DOMNodeList::class);
37- }
20+ public const string TEXTCONTENT_TYPE = XPathValue::class;
3821}
You can’t perform that action at this time.
0 commit comments