Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class RequestTokenStorage implements TokenStorageInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var TokenInterface|null |
||
11 | */ |
||
12 | protected $token = null; |
||
13 | |||
14 | /** |
||
15 | * @return TokenInterface |
||
16 | * |
||
17 | * @throws \LogicException if the token is not set |
||
18 | */ |
||
19 | 2 | public function get(): TokenInterface |
|
20 | { |
||
21 | 2 | if (!$this->has()) { |
|
22 | 1 | throw new \LogicException('No token has been set'); |
|
23 | } |
||
24 | |||
25 | 1 | return $this->token; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | 2 | public function has(): bool |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 1 | public function save(TokenInterface $token) |
|
42 | 1 | } |
|
43 | } |
||
44 |