| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class StorageUserProvider implements ApiKeyUserProvider |
||
| 14 | { |
||
| 15 | private $storage; |
||
| 16 | |||
| 17 | public function __construct(Reader $storage) |
||
| 18 | { |
||
| 19 | $this->storage = $storage; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function supportsClass($class): bool |
||
| 23 | { |
||
| 24 | return ApiUser::class === $class; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function loadUserByUsername($username): UserInterface |
||
| 28 | { |
||
| 29 | return new ApiUser($username); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function loadUserByApiKey(string $apiKey): UserInterface |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @throws UnsupportedUserException |
||
| 49 | */ |
||
| 50 | public function refreshUser(UserInterface $user): UserInterface |
||
| 55 |