Completed
Push — master ( 206c33...9e77c2 )
by Oscar
05:44
created

Shutdown::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
namespace Psr7Middlewares\Middleware;
4
5
use Psr7Middlewares\Utils;
6
use Psr7Middlewares\Middleware;
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
10
/**
11
 * Middleware to display temporary 503 maintenance pages.
12
 */
13
class Shutdown
14
{
15
    use Utils\HandlerTrait;
16
17
    /**
18
     * Execute the middleware.
19
     *
20
     * @param RequestInterface  $request
21
     * @param ResponseInterface $response
22
     * @param callable          $next
23
     *
24
     * @return ResponseInterface
25
     */
26
    public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next)
0 ignored issues
show
Unused Code introduced by
The parameter $next is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        $response = $this->executeHandler($request, $response);
29
30
        return $response->withStatus(503);
31
    }
32
}
33