Completed
Push — master ( 27322f...ead5e5 )
by Yann
02:16
created

ConsumeTokenEvent::getAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
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
 * @author Yann Eugoné <[email protected]>
11
 */
12
class ConsumeTokenEvent extends Event
13
{
14
    /**
15
     * @var Token
16
     */
17
    private $token;
18
19
    /**
20
     * @var DateTime|null
21
     */
22
    private $at;
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $at. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
23
24
    /**
25
     * @var array
26
     */
27
    private $information;
28
29
    /**
30
     * @param Token         $token
31
     * @param DateTime|null $at
32
     * @param array         $information
33
     */
34 1
    public function __construct(Token $token, DateTime $at = null, array $information)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $at. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
Coding Style introduced by
Parameters which have default values should be placed at the end.

If you place a parameter with a default value before a parameter with a default value, the default value of the first parameter will never be used as it will always need to be passed anyway:

// $a must always be passed; it's default value is never used.
function someFunction($a = 5, $b) { }
Loading history...
35
    {
36 1
        $this->token = $token;
37 1
        $this->at = $at;
38 1
        $this->information = $information;
39 1
    }
40
41
    /**
42
     * @return Token
43
     */
44 1
    public function getToken()
45
    {
46 1
        return $this->token;
47
    }
48
49
    /**
50
     * @return DateTime|null
51
     */
52
    public function getAt()
53
    {
54
        return $this->at;
55
    }
56
57
    /**
58
     * @return array
59
     */
60 1
    public function getInformation()
61
    {
62 1
        return $this->information;
63
    }
64
}
65