ConsumeTokenEvent::getAt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Yokai\SecurityTokenBundle\Event;
4
5
use DateTime;
6
use Symfony\Component\EventDispatcher\Event;
7
use Yokai\SecurityTokenBundle\Entity\Token;
8
9
/**
10
 * Event being dispatched before a Token is consumed.
11
 *
12
 * @author Yann Eugoné <[email protected]>
13
 */
14
class ConsumeTokenEvent extends Event
15
{
16
    /**
17
     * @var Token
18
     */
19
    private $token;
20
21
    /**
22
     * @var DateTime|null
23
     */
24
    private $at;
25
26
    /**
27
     * @var array
28
     */
29
    private $information;
30
31
    /**
32
     * @param Token         $token       The consumed token
33
     * @param DateTime|null $at          Date/time at which the token has been consumed
34
     * @param array         $information Some context information
35
     */
36 1
    public function __construct(Token $token, DateTime $at = null, array $information)
37
    {
38 1
        $this->token = $token;
39 1
        $this->at = $at;
40 1
        $this->information = $information;
41 1
    }
42
43
    /**
44
     * The consumed token
45
     *
46
     * @return Token
47
     */
48 1
    public function getToken()
49
    {
50 1
        return $this->token;
51
    }
52
53
    /**
54
     * Date/time at which the token has been consumed
55
     *
56
     * @return DateTime|null
57
     */
58
    public function getAt()
59
    {
60
        return $this->at;
61
    }
62
63
    /**
64
     * Some context information
65
     *
66
     * @return array
67
     */
68 1
    public function getInformation()
69
    {
70 1
        return $this->information;
71
    }
72
}
73