TokenUsedEvent::getPurpose()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Yokai\SecurityTokenBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
7
/**
8
 * @deprecated since 2.3 to be removed in 3.0. Rely on TokenAlreadyConsumedEvent instead.
9
 * @author Yann Eugoné <[email protected]>
10
 */
11
class TokenUsedEvent extends Event
12
{
13
    /**
14
     * @var string
15
     */
16
    private $purpose;
17
18
    /**
19
     * @var string
20
     */
21
    private $value;
22
23
    /**
24
     * @param string $purpose The token purpose
25
     * @param string $value   The token value
26
     */
27 1
    public function __construct($purpose, $value)
28
    {
29 1
        $this->purpose = $purpose;
30 1
        $this->value = $value;
31 1
    }
32
33
    /**
34
     * The token purpose
35
     *
36
     * @return string
37
     */
38 1
    public function getPurpose()
39
    {
40 1
        return $this->purpose;
41
    }
42
43
    /**
44
     * The token value
45
     *
46
     * @return string
47
     */
48 1
    public function getValue()
49
    {
50 1
        return $this->value;
51
    }
52
}
53