HttpMessageAwareTrait::getRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ps2alerts\Api\Contract;
4
5
use Zend\Diactoros\ServerRequest;
6
use Zend\Diactoros\Response;
7
8
trait HttpMessageAwareTrait
9
{
10
    /**
11
     * @var \Zend\Diactoros\ServerRequestFactory
12
     */
13
    protected $request;
14
15
    /**
16
     * @var \Zend\Diactoros\Response
17
     */
18
    protected $response;
19
20
    /**
21
     * Sets the http request object
22
     *
23
     * @param ServerRequest $obj
24
     */
25
    public function setRequest(ServerRequest $obj)
26
    {
27
        $this->request = $obj;
0 ignored issues
show
Documentation Bug introduced by
It seems like $obj of type object<Zend\Diactoros\ServerRequest> is incompatible with the declared type object<Zend\Diactoros\ServerRequestFactory> 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...
28
    }
29
30
    /**
31
     * Gets the http request object
32
     *
33
     * @return ServerRequest $obj
34
     */
35
    public function getRequest()
36
    {
37
        return $this->request;
38
    }
39
40
    /**
41
     * Sets the http response object
42
     *
43
     * @param Zend\Diactoros\Response
44
     */
45
    public function setResponse(Response $obj)
46
    {
47
        $this->response = $obj;
48
    }
49
50
    /**
51
     * Gets the http response object
52
     *
53
     * @return Zend\Diactoros\Response
54
     */
55
    public function getResponse()
56
    {
57
        return $this->response;
58
    }
59
}
60