RelayStateTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setRelayState() 0 4 1
A getRelayState() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Binding;
6
7
use SimpleSAML\SAML2\Assert\Assert;
8
9
/**
10
 * Trait grouping common functionality for binding that use a RelayState.
11
 *
12
 * @package simplesamlphp/saml2
13
 */
14
trait RelayStateTrait
15
{
16
    /**
17
     * The relay state.
18
     */
19
    protected ?string $relayState = null;
20
21
22
    /**
23
     * Set the RelayState associated with he message.
24
     */
25
    public function setRelayState(?string $relayState = null): void
26
    {
27
        Assert::nullOrValidRelayState($relayState);
28
        $this->relayState = $relayState;
29
    }
30
31
32
    /**
33
     * Get the RelayState associated with the message.
34
     */
35
    public function getRelayState(): ?string
36
    {
37
        return $this->relayState;
38
    }
39
}
40