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

DelegateProxy   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 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

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