| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 2 | public function verify(ServerRequestInterface $request): void |
|
| 36 | { |
||
| 37 | 2 | $apiKey = $request->getHeaderLine(self::HEADER_NAME); |
|
| 38 | 2 | if ($this->apiKeyService->check($apiKey)) { |
|
| 39 | 1 | return; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | throw VerifyAuthenticationException::withError( |
|
| 43 | 1 | RestUtils::INVALID_API_KEY_ERROR, |
|
| 44 | 1 | $this->translator->translate('Provided API key does not exist or is invalid.') |
|
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 53 |