Passed
Pull Request — master (#267)
by Tim
02:40
created

AuthnContextClassRef::__construct()   A

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\SAML2\XML\saml;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\SAML2\Constants;
10
use SimpleSAML\XML\DOMDocumentFactory;
11
use SimpleSAML\XML\Exception\InvalidDOMElementException;
12
use SimpleSAML\XML\XMLStringElementTrait;
13
14
/**
15
 * Class representing SAML2 AuthnContextClassRef
16
 *
17
 * @package simplesamlphp/saml2
18
 */
19
final class AuthnContextClassRef extends AbstractSamlElement
20
{
21
    use XMLStringElementTrait;
0 ignored issues
show
introduced by
The trait SimpleSAML\XML\XMLStringElementTrait requires some properties which are not provided by SimpleSAML\SAML2\XML\saml\AuthnContextClassRef: $localName, $namespaceURI
Loading history...
22
23
24
    /**
25
     * @param string $content
26
     */
27
    public function __construct(string $content)
28
    {
29
        $this->setContent($content);
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 \Exception on failure
38
     * @return void
39
     */
40
    protected function validateContent(string $content): void
41
    {
42
        Assert::notWhitespaceOnly($content);
43
    }
44
}
45