Completed
Push — master ( b7d1b1...24134c )
by Woody
8s
created

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