1616use DOMXpath ;
1717use Exception ;
1818use SAML2 \DOMDocumentFactory ;
19+ use SimpleSAML \Assert \Assert ;
1920use SimpleSAML \Configuration ;
2021use SimpleSAML \Error ;
2122use SimpleSAML \Metadata \MetaDataStorageHandler ;
@@ -100,7 +101,7 @@ public function getRelayState(): ?string
100101 */
101102 public function validate (): bool
102103 {
103- assert ($ this ->dom instanceof DOMDocument);
104+ Assert:: isInstanceOf ($ this ->dom , DOMDocument::class );
104105
105106 if ($ this ->messageValidated ) {
106107 // This message was validated externally
@@ -167,7 +168,7 @@ private function isNodeValidated($node): bool
167168 $ node = dom_import_simplexml ($ node );
168169 }
169170
170- assert ($ node instanceof DOMNode);
171+ Assert:: isInstanceOf ($ node, DOMNode::class );
171172
172173 return $ this ->validator ->isNodeValidated ($ node );
173174 }
@@ -183,13 +184,13 @@ private function isNodeValidated($node): bool
183184 */
184185 private function doXPathQuery (string $ query , DOMNode $ node = null ): DOMNodeList
185186 {
186- assert ( $ this -> dom instanceof DOMDocument );
187+ Assert:: isInstanceOf ( $ node , DOMNode::class );
187188
188189 if ($ node === null ) {
189190 $ node = $ this ->dom ->documentElement ;
190191 }
191192
192- assert ($ node instanceof DOMNode);
193+ Assert:: isInstanceOf ($ node, DOMNode::class );
193194
194195 $ xPath = new DOMXpath ($ this ->dom );
195196 $ xPath ->registerNamespace ('shibp ' , self ::SHIB_PROTOCOL_NS );
@@ -206,7 +207,7 @@ private function doXPathQuery(string $query, DOMNode $node = null): DOMNodeList
206207 */
207208 public function getSessionIndex (): ?string
208209 {
209- assert ( $ this -> dom instanceof DOMDocument );
210+ Assert:: isInstanceOf ( $ node , DOMNode::class );
210211
211212 $ query = '/shibp:Response/shib:Assertion/shib:AuthnStatement ' ;
212213 $ nodelist = $ this ->doXPathQuery ($ query );
0 commit comments