Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Response implements ArrayableInterface |
||
8 | { |
||
9 | /** |
||
10 | * Returns the status of the response as boolean. |
||
11 | * |
||
12 | * @var bool |
||
13 | */ |
||
14 | private $status = false; |
||
15 | |||
16 | /** |
||
17 | * Returns the text of the response as string. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private $responseString; |
||
22 | |||
23 | /** |
||
24 | * @param bool $status |
||
25 | * @param string $responseString |
||
26 | */ |
||
27 | public function __construct($status, $responseString) |
||
28 | { |
||
29 | $this->status = $status; |
||
30 | $this->responseString = $responseString; |
||
31 | } |
||
32 | |||
33 | public function toArray() |
||
34 | { |
||
35 | return [ |
||
36 | 'status' => $this->status, |
||
37 | 'response' => $this->responseString, |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | public function getStatus() |
||
42 | { |
||
43 | return $this->status; |
||
44 | } |
||
45 | |||
46 | public function getResponseString() |
||
49 | } |
||
50 | } |
||
51 |