PPID   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 16
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromXML() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\WSSecurity\XML\fed;
6
7
use DOMElement;
8
use SimpleSAML\WSSecurity\Assert\Assert;
9
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
10
use SimpleSAML\XMLSchema\Type\StringValue;
11
12
/**
13
 * A PPID element
14
 *
15
 * @package simplesamlphp/ws-security
16
 */
17
final class PPID extends AbstractAttributeExtensibleString
18
{
19
    /**
20
     * Create a class from XML
21
     *
22
     * @param \DOMElement $xml
23
     * @return static
24
     */
25
    public static function fromXML(DOMElement $xml): static
26
    {
27
        Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class);
28
        Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class);
29
30
        return new static(
31
            StringValue::fromString($xml->textContent),
32
            self::getAttributesNSFromXML($xml),
33
        );
34
    }
35
}
36