Node   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A validateContent() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SOAP\XML\env_200305;
6
7
use SimpleSAML\Assert\Assert;
8
use SimpleSAML\XML\Exception\SchemaViolationException;
9
use SimpleSAML\XML\StringElementTrait;
10
11
/**
12
 * Class representing a env:Node element.
13
 *
14
 * @package simplesaml/xml-soap
15
 */
16
final class Node extends AbstractSoapElement
17
{
18
    use StringElementTrait;
19
20
21
    /**
22
     * Initialize a env:Node
23
     *
24
     * @param string $node
25
     */
26
    public function __construct(string $node)
27
    {
28
        $this->setContent($node);
29
    }
30
31
32
    /**
33
     * Validate the content of the element.
34
     *
35
     * @param string $content  The value to go in the XML textContent
36
     * @throws \Exception on failure
37
     * @return void
38
     */
39
    protected function validateContent(string $content): void
40
    {
41
        Assert::validURI($content, SchemaViolationException::class); // Covers the empty string
42
    }
43
}
44