AbstractDoNotCacheConditionType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromXML() 0 6 1
A __construct() 0 2 1
A toXML() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML11\XML\saml;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
10
11
/**
12
 * Class representing a saml:DoNotCacheConditionType.
13
 *
14
 * @package simplesamlphp/saml11
15
 */
16
abstract class AbstractDoNotCacheConditionType extends AbstractConditionType
17
{
18
    /**
19
     * DoNotCacheConditionType constructor.
20
     */
21
    final public function __construct()
22
    {
23
    }
24
25
26
    /**
27
     * Convert XML into a DoNotCacheCondition
28
     *
29
     * @param \DOMElement $xml The XML element we should load
30
     * @return static
31
     *
32
     * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException
33
     *   if the qualified name of the supplied element is wrong
34
     */
35
    public static function fromXML(DOMElement $xml): static
36
    {
37
        Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class);
38
        Assert::same($xml->namespaceURI, static::getNamespaceURI(), InvalidDOMElementException::class);
39
40
        return new static();
41
    }
42
43
44
    /**
45
     * Convert this DoNotCacheCondition to XML.
46
     *
47
     * @param \DOMElement $parent The element we are converting to XML.
48
     * @return \DOMElement The XML element after adding the data corresponding to this DoNotCacheCondition.
49
     */
50
    public function toXML(?DOMElement $parent = null): DOMElement
51
    {
52
        return $this->instantiateParentElement($parent);
53
    }
54
}
55