Completed
Push — master ( 05e0c3...5b810f )
by Woody
02:35
created

HandlerProxy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Equip\Dispatch;
4
5
use Interop\Http\Server\RequestHandlerInterface;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\ServerRequestInterface;
8
9
class HandlerProxy
10
{
11
    /**
12
     * @var RequestHandlerInterface
13
     */
14
    private $adaptee;
15
16
    /**
17
     * @param RequestHandlerInterface $adaptee
18
     */
19 2
    public function __construct(RequestHandlerInterface $adaptee)
20
    {
21 2
        $this->adaptee = $adaptee;
22 2
    }
23
24
    /**
25
     * Process the request using a handler.
26
     *
27
     * @param ServerRequestInterface $request
28
     *
29
     * @return ResponseInterface
30
     */
31 2
    public function __invoke(ServerRequestInterface $request)
32
    {
33 2
        return $this->adaptee->handle($request);
34
    }
35
}
36