Passed
Push — master ( b6a195...1e79f7 )
by mcfog
03:21
created

MiddlewareIncluedHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A main() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lit\Nimo\Handlers;
6
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Server\MiddlewareInterface;
9
use Psr\Http\Server\RequestHandlerInterface;
10
11
class MiddlewareIncluedHandler extends AbstractWrapperHandler
12
{
13
    /**
14
     * @var MiddlewareInterface
15
     */
16
    protected $middleware;
17
18 1
    public function __construct(RequestHandlerInterface $handler, MiddlewareInterface $middleware)
19
    {
20 1
        parent::__construct($handler);
21 1
        $this->middleware = $middleware;
22 1
    }
23
24 1
    protected function main(): ResponseInterface
25
    {
26 1
        return $this->middleware->process($this->request, $this->innerHandler);
27
    }
28
}
29