GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Request::getMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace JumpCloud\Request;
4
5
use JumpCloud\Factory\ResponseFactoryInterface;
6
7
class Request implements RequestInterface
8
{
9
    /** @var  string */
10
    private $method;
11
12
    /** @var string */
13
    private $uri;
14
15
    /** @var array */
16
    private $headers;
17
18
    /** @var array */
19
    private $body;
20
21
    /**
22
     * @var ResponseFactoryInterface
23
     */
24
    private $responseFactory;
25
26
    /**
27
     * Request constructor.
28
     */
29 12
    public function __construct()
30
    {
31 12
        $this->method = 'GET';
32 12
        $this->headers = [];
33 12
        $this->body = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $body.

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...
34 12
    }
35
36
    /**
37
     * @return string
38
     */
39 12
    public function getMethod()
40
    {
41 12
        return $this->method;
42
    }
43
44
    /**
45
     * @param string $method
46
     */
47
    public function setMethod($method)
48
    {
49
        $this->method = $method;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 12
    public function getUri()
56
    {
57 12
        return $this->uri;
58
    }
59
60
    /**
61
     * @param string $uri
62
     */
63 12
    public function setUri($uri)
64
    {
65 12
        $this->uri = $uri;
66 12
    }
67
68
    /**
69
     * @return array
70
     */
71 12
    public function getHeaders()
72
    {
73 12
        return $this->headers;
74
    }
75
76
    /**
77
     * @param $header
78
     * @param $value
79
     */
80 12
    public function addHeader($header, $value)
81
    {
82 12
        $this->headers[$header] = $value;
83 12
    }
84
85
    /**
86
     * @return array
87
     */
88 12
    public function getBody()
89
    {
90 12
        return $this->body;
91
    }
92
93
    /**
94
     * @param array $body
95
     */
96 12
    public function setBody($body)
97
    {
98 12
        $this->body = $body;
99 12
    }
100
101
    /**
102
     * @return ResponseFactoryInterface
103
     */
104 12
    public function getResponseFactory()
105
    {
106 12
        return $this->responseFactory;
107
    }
108
109
    /**
110
     * @param ResponseFactoryInterface $responseFactory
111
     */
112 12
    public function setResponseFactory(ResponseFactoryInterface $responseFactory)
113
    {
114 12
        $this->responseFactory = $responseFactory;
115 12
    }
116
117
}
118