Issues (234)

src/Utils/XPath.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Utils;
6
7
use DOMNode;
8
use DOMXPath;
9
use SimpleSAML\XMLSecurity\Constants as C;
0 ignored issues
show
The type SimpleSAML\XMLSecurity\Constants was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use SimpleSAML\XPath\XPath as XPathUtils;
11
12
/**
13
 * Compilation of utilities for XPath.
14
 *
15
 * @package simplesamlphp/xml-security
16
 */
17
class XPath extends XPathUtils
18
{
19
    /**
20
     * Get a DOMXPath object that can be used to search for XMLDSIG elements.
21
     *
22
     * @param \DOMNode $node The document to associate to the DOMXPath object.
23
     * @param bool $autoregister Whether to auto-register all namespaces used in the document
24
     *
25
     * @return \DOMXPath A DOMXPath object ready to use in the given document, with the XMLDSIG namespace already
26
     * registered.
27
     */
28
    public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath
29
    {
30
        $xp = parent::getXPath($node, $autoregister);
31
32
        $xp->registerNamespace('ds', C::NS_XDSIG);
33
        $xp->registerNamespace('xenc', C::NS_XENC);
34
35
        return $xp;
36
    }
37
}
38