PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.0.0
Backup Migration v2.0.0
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / analyst / src / ApiResponse.php
backup-backup / analyst / src Last commit date
Account 8 months ago Cache 8 months ago Contracts 8 months ago Core 8 months ago Http 8 months ago Notices 8 months ago Analyst.php 8 months ago ApiRequestor.php 8 months ago ApiResponse.php 8 months ago Collector.php 8 months ago Mutator.php 8 months ago helpers.php 8 months ago
ApiResponse.php
45 lines
1 <?php
2
3 namespace Analyst;
4
5 class ApiResponse
6 {
7 /**
8 * Response headers
9 *
10 * @var array
11 */
12 public $headers;
13
14 /**
15 * Response body
16 *
17 * @var mixed
18 */
19 public $body;
20
21 /**
22 * Status code
23 *
24 * @var string
25 */
26 public $code;
27
28 public function __construct($body, $code, $headers)
29 {
30 $this->body = $body;
31 $this->code = $code;
32 $this->headers = $headers;
33 }
34
35 /**
36 * Whether status code is successful
37 *
38 * @return bool
39 */
40 public function isSuccess()
41 {
42 return $this->code >= 200 && $this->code < 300;
43 }
44 }
45