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

Node::validateContent()   A

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
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