Delegate::getRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace tests\mocks;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
use Interop\Http\ServerMiddleware\DelegateInterface;
7
8
class Delegate implements DelegateInterface
9
{
10
    /**
11
     * A store of the request that was passed in.
12
     *
13
     * @var Psr\Http\Message\ServerRequestInterface
0 ignored issues
show
Bug introduced by
The type tests\mocks\Psr\Http\Mes...\ServerRequestInterface was not found. Did you mean Psr\Http\Message\ServerRequestInterface? If so, make sure to prefix the type with \.
Loading history...
14
     */
15
    protected $request;
16
17
    /**
18
     * Process method to conform to the delegate interface.
19
     *
20
     * @param ServerRequestInterface $request
21
     * @return void
22
     */
23
    public function process(ServerRequestInterface $request)
24
    {
25
        $this->request = $request;
0 ignored issues
show
Documentation Bug introduced by
It seems like $request of type Psr\Http\Message\ServerRequestInterface is incompatible with the declared type tests\mocks\Psr\Http\Mes...\ServerRequestInterface of property $request.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
26
    }
27
28
    /**
29
     * Get the request that was processed.
30
     *
31
     * @return void
32
     */
33
    public function getRequest()
34
    {
35
        return $this->request;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->request returns the type tests\mocks\Psr\Http\Mes...\ServerRequestInterface which is incompatible with the documented return type void.
Loading history...
36
    }
37
}
38