Completed
Push — master ( 0563c6...cb42e4 )
by Yann
02:20
created

TokenUsage::getInformation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Yokai\SecurityTokenBundle\Entity;
4
5
use DateTime;
6
7
class TokenUsage
8
{
9
    /**
10
     * @var int
11
     */
12
    private $id;
13
14
    /**
15
     * @var Token
16
     */
17
    private $token;
18
19
    /**
20
     * @var DateTime
21
     */
22
    private $createdAt;
23
24
    /**
25
     * @var array
26
     */
27
    private $information = [];
28
29
    /**
30
     * @param Token    $token
31
     * @param array    $information
32
     * @param DateTime $createdAt
33
     */
34 3
    public function __construct(Token $token, array $information, DateTime $createdAt = null)
35
    {
36 3
        $this->token = $token;
37 3
        $this->information = $information;
38 3
        $this->createdAt = $createdAt ?: new DateTime();
39 3
    }
40
41
    /**
42
     * @return int
43
     */
44
    public function getId()
45
    {
46
        return $this->id;
47
    }
48
49
    /**
50
     * @return Token
51
     */
52
    public function getToken()
53
    {
54
        return $this->token;
55
    }
56
57
    /**
58
     * @return DateTime
59
     */
60 1
    public function getCreatedAt()
61
    {
62 1
        return $this->createdAt;
63
    }
64
65
    /**
66
     * @return array
67
     */
68 1
    public function getInformation()
69
    {
70 1
        return $this->information;
71
    }
72
}
73