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

Text::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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