Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function loadUserByApiKey(string $apiKey): UserInterface |
||
33 | { |
||
34 | try { |
||
35 | $key = $this->storage->get($apiKey); |
||
36 | } catch (KeyNotFound $e) { |
||
37 | throw new InvalidApiKey(); |
||
38 | } |
||
39 | |||
40 | if ($key->expired()) { |
||
41 | throw new InvalidApiKey(); |
||
42 | } |
||
43 | |||
44 | return $this->loadUserByUsername($key->identity()); |
||
45 | } |
||
55 |