UsageTrait::getUsage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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