| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 3 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
| 30 | { |
||
| 31 | 3 | if ($this->expectedAuthHeader !== $request->getHeaderLine('Authorization')) { |
|
| 32 | 2 | return new TextResponse( |
|
| 33 | 2 | 'Authentication required', |
|
| 34 | 2 | 401, |
|
| 35 | 2 | ['WWW-Authenticate' => 'Basic realm="'. $this->realm . '"'] |
|
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | return $handler->handle($request); |
|
| 40 | } |
||
| 41 | } |
||
| 42 |