Audience   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A validateContent() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\saml;
6
7
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
8
use SimpleSAML\SAML2\XML\URIElementTrait;
9
use SimpleSAML\XML\SchemaValidatableElementInterface;
10
use SimpleSAML\XML\SchemaValidatableElementTrait;
11
12
/**
13
 * Class representing a saml:Audience element.
14
 *
15
 * @package simplesaml/saml2
16
 */
17
final class Audience extends AbstractSamlElement implements SchemaValidatableElementInterface
18
{
19
    use SchemaValidatableElementTrait;
20
    use URIElementTrait;
0 ignored issues
show
introduced by
The trait SimpleSAML\SAML2\XML\URIElementTrait requires some properties which are not provided by SimpleSAML\SAML2\XML\saml\Audience: $localName, $namespaceURI
Loading history...
21
22
23
    /**
24
     * @param string $content
25
     */
26
    public function __construct(string $content)
27
    {
28
        $this->setContent($content);
29
    }
30
31
32
    /**
33
     * Validate the content of the element.
34
     *
35
     * @param string $content  The value to go in the XML textContent
36
     * @throws \Exception on failure
37
     * @return void
38
     */
39
    protected function validateContent(string $content): void
40
    {
41
        SAMLAssert::validEntityID($content);
42
    }
43
}
44