Total Complexity | 13 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class CurlResponse |
||
13 | { |
||
14 | |||
15 | private $http_code; |
||
16 | private $result; |
||
17 | |||
18 | public function __construct(int $http_code, string $result) |
||
19 | { |
||
20 | $this->http_code = $http_code; |
||
21 | $this->result = $result; |
||
22 | } |
||
23 | |||
24 | public function isValid(): bool |
||
25 | { |
||
26 | return $this->http_code > 199 && $this->http_code < 300; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return int |
||
31 | */ |
||
32 | public function getHTTPCode(): int |
||
33 | { |
||
34 | return $this->http_code; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return array|null |
||
39 | */ |
||
40 | public function getJSON(): ?array |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function isJSON(): bool |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getError(): string |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return array |
||
66 | */ |
||
67 | public function getErrors(): array |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getRaw(): string |
||
81 |