Total Complexity | 3 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class HmacToken extends AbstractToken |
||
13 | { |
||
14 | /** |
||
15 | * @var \Symfony\Component\HttpFoundation\Request |
||
16 | * The authenticated request. |
||
17 | */ |
||
18 | protected $request; |
||
19 | |||
20 | /** |
||
21 | * @var \Acquia\Hmac\KeyInterface |
||
22 | * The authenticated credentials. |
||
23 | */ |
||
24 | protected $key; |
||
25 | |||
26 | /** |
||
27 | * Initializes the token. |
||
28 | * |
||
29 | * @param \Symfony\Component\HttpFoundation\Request $request |
||
30 | * The authenticated request. |
||
31 | * @param \Acquia\Hmac\KeyInterface $key |
||
32 | * An optional set of authenticated credentials. |
||
33 | * @param \Symfony\Component\Security\Core\Role\RoleInterface[]|string[] $roles |
||
34 | * An array of roles. |
||
35 | */ |
||
36 | 6 | public function __construct(Request $request, KeyInterface $key = null, array $roles = []) |
|
37 | { |
||
38 | 6 | parent::__construct($roles); |
|
39 | |||
40 | 6 | $this->request = $request; |
|
41 | 6 | $this->key = $key; |
|
42 | 6 | } |
|
43 | |||
44 | /** |
||
45 | * Returns the authenticated request associated with the token. |
||
46 | * |
||
47 | * @return \Symfony\Component\HttpFoundation\Request |
||
48 | * The authenticated request. |
||
49 | */ |
||
50 | 3 | public function getRequest() |
|
51 | { |
||
52 | 3 | return $this->request; |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * {@inheritDoc} |
||
57 | */ |
||
58 | 3 | public function getCredentials() |
|
61 | } |
||
62 | } |
||
63 |