Completed
Pull Request — master (#32)
by Yann
03:30
created

TokenAlreadyConsumedEvent::getPurpose()   A

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
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
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
 * Event being dispatched when a Token is fetched but already consumed.
9
 *
10
 * @author Yann Eugoné <[email protected]>
11
 */
12
class TokenAlreadyConsumedEvent extends Event
13
{
14
    /**
15
     * @var string
16
     */
17
    private $purpose;
18
19
    /**
20
     * @var string
21
     */
22
    private $value;
23
24
    /**
25
     * @param string $purpose The token purpose
26
     * @param string $value   The token value
27
     */
28 1
    public function __construct(string $purpose, string $value)
29
    {
30 1
        $this->purpose = $purpose;
31 1
        $this->value = $value;
32 1
    }
33
34
    /**
35
     * The token purpose
36
     *
37
     * @return string
38
     */
39 1
    public function getPurpose(): string
40
    {
41 1
        return $this->purpose;
42
    }
43
44
    /**
45
     * The token value
46
     *
47
     * @return string
48
     */
49 1
    public function getValue(): string
50
    {
51 1
        return $this->value;
52
    }
53
}
54