Passed
Push — master ( c93035...6d9219 )
by Tim
12:59 queued 11:11
created

FaultActor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validateContent() 0 3 1
A __construct() 0 3 1
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