Proxies::fromXML()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\CAS\XML;
6
7
use DOMElement;
8
use SimpleSAML\CAS\Assert\Assert;
9
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
10
11
/**
12
 * Class for CAS proxies
13
 *
14
 * @package simplesamlphp/xml-cas
15
 */
16
final class Proxies extends AbstractProxies
0 ignored issues
show
Bug introduced by
The type SimpleSAML\CAS\XML\AbstractProxies 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...
17
{
18
    /**
19
     * Convert XML into a Proxies-element
20
     *
21
     * @param \DOMElement $xml The XML element we should load
22
     * @return static
23
     *
24
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
25
     *  if the qualified name of the supplied element is wrong
26
     */
27
    public static function fromXML(DOMElement $xml): static
28
    {
29
        Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class);
30
        Assert::same($xml->namespaceURI, static::getNamespaceURI(), InvalidDOMElementException::class);
31
32
        return new static(
33
            Proxy::getChildrenOfClass($xml),
34
        );
35
    }
36
}
37