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

Text   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 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\LocalizedStringElementTrait;
9
10
/**
11
 * Class representing a env:Text element.
12
 *
13
 * @package simplesaml/xml-soap
14
 */
15
final class Text extends AbstractSoapElement
16
{
17
    use LocalizedStringElementTrait;
1 ignored issue
show
introduced by
The trait SimpleSAML\XML\LocalizedStringElementTrait requires some properties which are not provided by SimpleSAML\SOAP\XML\env_200305\Text: $localName, $namespaceURI
Loading history...
18
19
20
    /**
21
     * Initialize a env:Text
22
     *
23
     * @param string $language
24
     * @param string $content
25
     */
26
    public function __construct(string $language, string $content)
27
    {
28
        $this->setContent($content);
29
        $this->setLanguage($language);
30
    }
31
32
33
    /**
34
     * Validate the content of the element.
35
     *
36
     * @param string $content  The value to go in the XML textContent
37
     * @throws \SimpleSAML\Assert\AssertionFailedException on failure
38
     * @return void
39
     */
40
    protected function validateContent(string $content): void
41
    {
42
        Assert::notWhitespaceOnly($content);
43
    }
44
}
45