FaultActor::validateContent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SOAP\XML\env_200106;
6
7
use SimpleSAML\Assert\Assert;
8
use SimpleSAML\XML\AbstractElement;
9
use SimpleSAML\XML\Exception\SchemaViolationException;
10
use SimpleSAML\XML\StringElementTrait;
11
12
/**
13
 * Class representing a faultactor element.
14
 *
15
 * @package simplesaml/xml-soap
16
 */
17
final class FaultActor extends AbstractElement
18
{
19
    use StringElementTrait;
20
21
    /** @var string */
22
    public const LOCALNAME = 'faultactor';
23
24
    /** @var null */
25
    public const NS = null;
26
27
    /** @var null */
28
    public const NS_PREFIX = null;
29
30
31
    /**
32
     * Initialize an faultactor
33
     *
34
     * @param string $faultActor
35
     */
36
    public function __construct(string $faultActor)
37
    {
38
        $this->setContent($faultActor);
39
    }
40
41
42
    /**
43
     * Validate the content of the element.
44
     *
45
     * @param string $content  The value to go in the XML textContent
46
     * @throws \Exception on failure
47
     * @return void
48
     */
49
    protected function validateContent(string $content): void
50
    {
51
        Assert::validURI($content, SchemaViolationException::class); // Covers the empty string
52
    }
53
}
54