Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
42 | 12 | public function getToken() |
|
43 | { |
||
44 | 12 | $token = $this->tokenStorage->getAccessToken(); |
|
45 | 12 | if (!is_null($token)) { |
|
|
|||
46 | 9 | return new Token($token); |
|
47 | } |
||
48 | |||
49 | 5 | if ($this->tokenStorage->getRefreshToken()) { |
|
50 | 1 | return $this->refreshToken(); |
|
51 | } |
||
52 | |||
53 | 4 | $token = $this->anonymousProvider->getToken(); |
|
54 | 4 | $this->storeToken($token); |
|
55 | |||
56 | 4 | return $token; |
|
57 | } |
||
65 |