Passed
Push — master ( e74838...32ce96 )
by Tim
02:43
created

Node   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

2 Methods

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