Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
32 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface |
||
33 | { |
||
34 | $file = $this->container->get('app.root') . '/.down'; |
||
35 | |||
36 | if (file_exists($file)) { |
||
37 | return (new ResponseFactory)->createResponse(503) |
||
38 | ->withHeaderObject(new HeaderRetryAfter(new DateTime('+5 minutes'))); |
||
39 | } |
||
40 | |||
41 | return $handler->handle($request); |
||
42 | } |
||
44 |