HandlerProcessorAdapter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 8
c 0
b 0
f 0
dl 0
loc 26
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Phact\Router\Invoker;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Psr\Http\Message\ServerRequestInterface;
7
use Psr\Http\Server\RequestHandlerInterface;
8
9
class HandlerProcessorAdapter implements RequestHandlerInterface
10
{
11
    /**
12
     * @var HandlerProcessorInterface
13
     */
14
    protected $processor;
15
16
    protected $originalHandler;
17
    /**
18
     * @var array
19
     */
20
    protected $variables;
21
22 16
    public function __construct(HandlerProcessorInterface $processor, $originalHandler, array $variables = [])
23
    {
24 16
        $this->processor = $processor;
25 16
        $this->originalHandler = $originalHandler;
26 16
        $this->variables = $variables;
27 16
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32 14
    public function handle(ServerRequestInterface $request): ResponseInterface
33
    {
34 14
        return $this->processor->processHandler($request, $this->originalHandler, $this->variables);
35
    }
36
}
37