Completed
Pull Request — master (#4)
by Michael
03:53
created

DelegateToCallableAdapter::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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 implements DelegateInterface
0 ignored issues
show
Bug introduced by
There is one abstract method process in this class; you could implement it, or declare this class as abstract.
Loading history...
9
{
10
    /**
11
     * @var DelegateInterface
12
     */
13
    private $adaptee;
14
15
    /**
16
     * @param DelegateInterface $adaptee
17
     */
18
    public function __construct(DelegateInterface $adaptee)
19
    {
20
        $this->adaptee = $adaptee;
21
    }
22
23
    /**
24
     * Process the request using a delegate.
25
     *
26
     * @param RequestInterface $request
27
     *
28
     * @return ResponseInterface
29
     */
30
    public function __invoke(RequestInterface $request)
31
    {
32
        return $adaptee->process($request);
0 ignored issues
show
Bug introduced by
The variable $adaptee does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
33
    }
34
}
35