Total Complexity | 5 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class Http implements \JsonSerializable |
||
11 | { |
||
12 | /** |
||
13 | * The raw url of the correlating http request. |
||
14 | * |
||
15 | * @var string|null |
||
16 | */ |
||
17 | private $url; |
||
18 | |||
19 | /** |
||
20 | * The status code of the http request. |
||
21 | * |
||
22 | * @var int|null |
||
23 | */ |
||
24 | private $statusCode; |
||
25 | |||
26 | /** |
||
27 | * The method of the http request. |
||
28 | * |
||
29 | * @var string|null |
||
30 | */ |
||
31 | private $method; |
||
32 | |||
33 | /** |
||
34 | * @param string|null $url |
||
35 | * @param int|null $statusCode |
||
36 | * @param string|null $method |
||
37 | */ |
||
38 | 3 | public function __construct( |
|
39 | $url = null, |
||
40 | $statusCode = null, |
||
41 | $method = null |
||
42 | ) { |
||
43 | 3 | $this->url = $url; |
|
44 | 3 | $this->statusCode = $statusCode; |
|
45 | 3 | $this->method = $method; |
|
46 | 3 | } |
|
47 | |||
48 | /** |
||
49 | * @return string|null |
||
50 | */ |
||
51 | 1 | public function url() |
|
52 | { |
||
53 | 1 | return $this->url; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return int|null |
||
58 | */ |
||
59 | 1 | public function statusCode() |
|
60 | { |
||
61 | 1 | return $this->statusCode; |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string|null |
||
66 | */ |
||
67 | 1 | public function method() |
|
68 | { |
||
69 | 1 | return $this->method; |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return array |
||
74 | */ |
||
75 | 1 | public function jsonSerialize() |
|
81 | 1 | ]; |
|
82 | } |
||
83 | } |
||
84 |