RequestState::serialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AerialShip\SamlSPBundle\State\Request;
4
5
class RequestState implements \Serializable
6
{
7
    /** @var  string */
8
    private $id;
9
10
    /** @var  string */
11
    private $destination;
12
13
14
    /**
15
     * @param string $destination
16
     */
17
    public function setDestination($destination)
18
    {
19
        $this->destination = $destination;
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getDestination()
26
    {
27
        return $this->destination;
28
    }
29
30
    /**
31
     * @param string $id
32
     */
33
    public function setId($id)
34
    {
35
        $this->id = $id;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getId()
42
    {
43
        return $this->id;
44
    }
45
46
47
    /**
48
     * (PHP 5 &gt;= 5.1.0)<br/>
49
     * String representation of object
50
     * @link http://php.net/manual/en/serializable.serialize.php
51
     * @return string the string representation of the object or null
52
     */
53
    public function serialize()
54
    {
55
        return serialize(array($this->id, $this->destination));
56
    }
57
58
    /**
59
     * (PHP 5 &gt;= 5.1.0)<br/>
60
     * Constructs the object
61
     * @link http://php.net/manual/en/serializable.unserialize.php
62
     * @param string $serialized <p>
63
     * The string representation of the object.
64
     * </p>
65
     * @return void
66
     */
67
    public function unserialize($serialized)
68
    {
69
        list($this->id, $this->destination) = unserialize($serialized);
70
    }
71
}
72