Terminate::toXML()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\samlp;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Assert\Assert;
9
use SimpleSAML\XML\SchemaValidatableElementInterface;
10
use SimpleSAML\XML\SchemaValidatableElementTrait;
11
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
12
13
/**
14
 * Class representing a samlp:Terminate element.
15
 *
16
 * @package simplesaml/saml2
17
 */
18
final class Terminate extends AbstractSamlpElement implements SchemaValidatableElementInterface
0 ignored issues
show
Bug introduced by
The type SimpleSAML\SAML2\XML\samlp\AbstractSamlpElement 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...
19
{
20
    use SchemaValidatableElementTrait;
21
22
23
    /**
24
     * Convert XML into a Terminate
25
     *
26
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
27
     *   if the qualified name of the supplied element is wrong
28
     */
29
    public static function fromXML(DOMElement $xml): static
30
    {
31
        Assert::same($xml->localName, 'Terminate', InvalidDOMElementException::class);
32
        Assert::same($xml->namespaceURI, Terminate::NS, InvalidDOMElementException::class);
33
34
        return new static();
35
    }
36
37
38
    /**
39
     * Convert this Terminate to XML.
40
     */
41
    public function toXML(?DOMElement $parent = null): DOMElement
42
    {
43
        return $this->instantiateParentElement($parent);
44
    }
45
}
46