RequestKET   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toXML() 0 3 1
A fromXML() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\WSSecurity\XML\wst_200502;
6
7
use DOMElement;
8
use SimpleSAML\WSSecurity\Assert\Assert;
9
use SimpleSAML\XML\SchemaValidatableElementInterface;
10
use SimpleSAML\XML\SchemaValidatableElementTrait;
11
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
12
13
/**
14
 * A RequestKET element
15
 *
16
 * @package simplesamlphp/ws-security
17
 */
18
final class RequestKET extends AbstractWstElement implements SchemaValidatableElementInterface
19
{
20
    use SchemaValidatableElementTrait;
0 ignored issues
show
introduced by
The trait SimpleSAML\XML\SchemaValidatableElementTrait requires some properties which are not provided by SimpleSAML\WSSecurity\XML\wst_200502\RequestKET: $message, $line
Loading history...
21
22
23
    /**
24
     * Convert XML into a class instance
25
     *
26
     * @param \DOMElement $xml The XML element we should load
27
     * @return static
28
     *
29
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
30
     *   If the qualified name of the supplied element is wrong
31
     */
32
    public static function fromXML(DOMElement $xml): static
33
    {
34
        Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class);
35
        Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class);
36
37
        return new static();
38
    }
39
40
41
    /**
42
     * Convert this element to XML.
43
     *
44
     * @param \DOMElement|null $parent The element we should append this element to.
45
     * @return \DOMElement
46
     */
47
    public function toXML(?DOMElement $parent = null): DOMElement
48
    {
49
        return $this->instantiateParentElement($parent);
50
    }
51
}
52