| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function respondToRequest(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface |
||
| 27 | { |
||
| 28 | $client = $this->validateClient($request); |
||
| 29 | [$tokenType, $token] = $this->validateToken($request, $client); |
||
| 30 | |||
| 31 | $responseType = $this->getResponseType(); |
||
| 32 | |||
| 33 | if ($tokenType !== null && $token !== null) { |
||
| 34 | $responseType->setActive(true); |
||
| 35 | $responseType->setTokenType($tokenType); |
||
| 36 | $responseType->setToken($token); |
||
| 37 | } else { |
||
| 38 | $responseType->setActive(false); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $responseType->generateHttpResponse($response); |
||
| 42 | } |
||
| 44 |