SSOState::setNameID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace AerialShip\SamlSPBundle\Model;
4
5
/**
6
 * @api
7
 */
8
abstract class SSOState implements \Serializable
9
{
10
    /** @var string */
11
    protected $providerID;
12
13
    /** @var string */
14
    protected $authenticationServiceName;
15
16
    /** @var string */
17
    protected $sessionIndex;
18
19
    /** @var string */
20
    protected $nameID;
21
22
    /** @var string */
23
    protected $nameIDFormat;
24
25
    /** @var \DateTime */
26
    protected $createdOn;
27
28
    /**
29
     * @param string $providerID
30
     *
31
     * @return SSOState
32
     */
33
    public function setProviderID($providerID)
34
    {
35
        $this->providerID = $providerID;
36
37
        return $this;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getProviderID()
44
    {
45
        return $this->providerID;
46
    }
47
48
    /**
49
     * @param string $authenticationServiceName
50
     *
51
     * @return SSOState
52
     */
53
    public function setAuthenticationServiceName($authenticationServiceName)
54
    {
55
        $this->authenticationServiceName = $authenticationServiceName;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getAuthenticationServiceName()
64
    {
65
        return $this->authenticationServiceName;
66
    }
67
68
    /**
69
     * @param string $nameID
70
     *
71
     * @return SSOState
72
     */
73
    public function setNameID($nameID)
74
    {
75
        $this->nameID = $nameID;
76
77
        return $this;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getNameID()
84
    {
85
        return $this->nameID;
86
    }
87
88
    /**
89
     * @param string $nameIDFormat
90
     *
91
     * @return SSOState
92
     */
93
    public function setNameIDFormat($nameIDFormat)
94
    {
95
        $this->nameIDFormat = $nameIDFormat;
96
97
        return $this;
98
    }
99
100
    /**
101
     * @return string
102
     */
103
    public function getNameIDFormat()
104
    {
105
        return $this->nameIDFormat;
106
    }
107
108
    /**
109
     * @param string $sessionIndex
110
     *
111
     * @return SSOState
112
     */
113
    public function setSessionIndex($sessionIndex)
114
    {
115
        $this->sessionIndex = $sessionIndex;
116
117
        return $this;
118
    }
119
120
    /**
121
     * @return string
122
     */
123
    public function getSessionIndex()
124
    {
125
        return $this->sessionIndex;
126
    }
127
128
    /**
129
     * @return \DateTime
130
     */
131
    public function getCreatedOn()
132
    {
133
        return $this->createdOn;
134
    }
135
136
    /**
137
     * @param \DateTime $createdOn
138
     *
139
     * @return SSOState
140
     */
141
    public function setCreatedOn(\DateTime $createdOn)
142
    {
143
        $this->createdOn = $createdOn;
144
145
        return $this;
146
    }
147
148
    /**
149
     * (PHP 5 &gt;= 5.1.0)<br/>
150
     * String representation of object
151
     * @link http://php.net/manual/en/serializable.serialize.php
152
     * @return string the string representation of the object or null
153
     */
154
    public function serialize()
155
    {
156
        return serialize(
157
            array(
158
                $this->providerID,
159
                $this->authenticationServiceName,
160
                $this->sessionIndex,
161
                $this->nameID,
162
                $this->nameIDFormat,
163
                $this->createdOn,
164
            )
165
        );
166
    }
167
168
    /**
169
     * (PHP 5 &gt;= 5.1.0)<br/>
170
     * Constructs the object
171
     * @link http://php.net/manual/en/serializable.unserialize.php
172
     * @param string $serialized <p>
173
     * The string representation of the object.
174
     * </p>
175
     * @return void
176
     */
177
    public function unserialize($serialized)
178
    {
179
        $data = unserialize($serialized);
180
181
        // add a few extra elements in the array to ensure that we have enough keys when unserializing
182
        // older data which does not include all properties.
183
        $data = array_merge($data, array_fill(0, 4, null));
184
185
        list(
186
            $this->providerID,
187
            $this->authenticationServiceName,
188
            $this->sessionIndex,
189
            $this->nameID,
190
            $this->nameIDFormat,
191
            $this->createdOn
192
            ) = $data;
193
    }
194
}
195