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

DelegateToCallableAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 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