Completed
Push — master ( 24134c...51b77a )
by Woody
9s
created

DelegateProxy::__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\Middleware\DelegateInterface;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\ResponseInterface;
8
9
class DelegateProxy
10
{
11
    /**
12
     * @var DelegateInterface
13
     */
14
    private $adaptee;
15
16
    /**
17
     * @param DelegateInterface $adaptee
18
     */
19 2
    public function __construct(DelegateInterface $adaptee)
20
    {
21 2
        $this->adaptee = $adaptee;
22 2
    }
23
24
    /**
25
     * Process the request using a delegate.
26
     *
27
     * @param RequestInterface $request
28
     *
29
     * @return ResponseInterface
30
     */
31 2
    public function __invoke(RequestInterface $request)
32
    {
33 2
        return $this->adaptee->process($request);
34
    }
35
}
36