NextHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A handle() 0 3 1
1
<?php
2
3
namespace Starch\Middleware;
4
5
use Closure;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\ServerRequestInterface;
8
use Psr\Http\Server\RequestHandlerInterface;
9
10
class NextHandler implements RequestHandlerInterface
11
{
12
    /**
13
     * @var Closure
14
     */
15
    private $next;
16
17 3
    public function __construct(Closure $next)
18
    {
19 3
        $this->next = $next;
20 3
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25 3
    public function handle(ServerRequestInterface $request): ResponseInterface
26
    {
27 3
        return ($this->next)($request);
28
    }
29
}
30