Issues (311)

src/XML/dsig11/Curve.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\XML\dsig11;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
10
use SimpleSAML\XMLSchema\Exception\MissingElementException;
11
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
12
13
use function array_pop;
14
15
/**
16
 * Class representing a dsig11:Curve element.
17
 *
18
 * @package simplesaml/xml-security
19
 */
20
final class Curve extends AbstractCurveType
21
{
22
    /**
23
     * Convert XML into a class instance
24
     *
25
     * @param \DOMElement $xml The XML element we should load
26
     *
27
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
28
     *   If the qualified name of the supplied element is wrong
29
     */
30
    public static function fromXML(DOMElement $xml): static
31
    {
32
        Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class);
33
        Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class);
34
35
        $a = A::getChildrenOfClass($xml);
36
        Assert::minCount($a, 1, MissingElementException::class);
37
        Assert::maxCount($a, 1, TooManyElementsException::class);
38
39
        $b = B::getChildrenOfClass($xml);
0 ignored issues
show
The type SimpleSAML\XMLSecurity\XML\dsig11\B 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...
40
        Assert::minCount($b, 1, MissingElementException::class);
41
        Assert::maxCount($b, 1, TooManyElementsException::class);
42
43
        return new static(
44
            array_pop($a),
45
            array_pop($b),
46
        );
47
    }
48
}
49