UsageTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 5
c 1
b 0
f 1
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUsage() 0 3 1
A setUsage() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\WSSecurity\XML\wsse;
6
7
use SimpleSAML\WSSecurity\Assert\Assert;
8
use SimpleSAML\XML\Exception\SchemaViolationException;
9
10
/**
11
 * @package simplesamlphp/ws-security
12
 */
13
trait UsageTrait
14
{
15
    /** @var string|null */
16
    protected ?string $usage;
17
18
19
    /**
20
     * @return string|null
21
     */
22
    public function getUsage(): ?string
23
    {
24
        return $this->usage;
25
    }
26
27
28
    /**
29
     * @param string $usage|null
30
     */
31
    private function setUsage(?string $usage): void
32
    {
33
        Assert::nullOrValidURI($usage, SchemaViolationException::class);
34
        $this->usage = $usage;
35
    }
36
}
37