Passed
Pull Request — master (#267)
by Tim
04:13 queued 01:48
created

AffiliateMember   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateContent() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\md;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\XML\XMLStringElementTrait;
10
11
/**
12
 * Class implementing AffiliateMember.
13
 *
14
 * @package simplesamlphp/saml2
15
 */
16
final class AffiliateMember extends AbstractMdElement
17
{
18
    use XMLStringElementTrait;
1 ignored issue
show
introduced by
The trait SimpleSAML\XML\XMLStringElementTrait requires some properties which are not provided by SimpleSAML\SAML2\XML\md\AffiliateMember: $localName, $namespaceURI
Loading history...
19
20
21
    /**
22
     * Validate the content of the element.
23
     *
24
     * @param string $content  The value to go in the XML textContent
25
     * @throws \Exception on failure
26
     * @return void
27
     */
28
    protected function validateContent(string $content): void
29
    {
30
        Assert::notEmpty($content, 'AffiliateMember cannot be empty');
31
        Assert::maxLength($content, 1024, 'The entityID attribute cannot be longer than 1024 characters.');
32
    }
33
}
34