1 | <?php |
||
7 | class InstagramResponse |
||
8 | { |
||
|
|||
9 | /** @var int $status_code */ |
||
10 | private $statusCode; |
||
11 | |||
12 | /** @var string $protocol */ |
||
13 | private $protocol = '1.1'; |
||
14 | |||
15 | /** @var array $headers */ |
||
16 | private $headers = []; |
||
17 | |||
18 | /** @var bool */ |
||
19 | private $isPagination = false; |
||
20 | |||
21 | /** @var object */ |
||
22 | private $pagination; |
||
23 | |||
24 | /** @var bool */ |
||
25 | private $isMetaData = false; |
||
26 | |||
27 | /** @var object */ |
||
28 | private $metaData; |
||
29 | |||
30 | /** @var object */ |
||
31 | private $data; |
||
32 | |||
33 | /** @var object $body */ |
||
34 | private $body; |
||
35 | |||
36 | /* |
||
37 | * @param Response $response |
||
38 | * @return this |
||
39 | * @throws InstagramResponseException |
||
40 | */ |
||
41 | public function __construct(Response $response) |
||
49 | |||
50 | /* |
||
51 | * Set Values to the class members |
||
52 | * @param Response $response |
||
53 | * @return void |
||
54 | */ |
||
55 | private function setParams($response) |
||
63 | |||
64 | private function extractBodyParts() |
||
78 | |||
79 | /* |
||
80 | * Get response |
||
81 | * @return object|string |
||
82 | */ |
||
83 | public function getBody() |
||
87 | |||
88 | /* |
||
89 | * Get Status Code |
||
90 | * @return int |
||
91 | */ |
||
92 | public function getStatusCode() |
||
96 | |||
97 | /* |
||
98 | * Get specific header |
||
99 | * @param string $header |
||
100 | * @retrun string |
||
101 | */ |
||
102 | public function getHeader($header) |
||
106 | |||
107 | /* |
||
108 | * Get all headers |
||
109 | * @retrun array |
||
110 | */ |
||
111 | public function getHeaders() |
||
115 | |||
116 | /* |
||
117 | * Get data from body |
||
118 | * @return object |
||
119 | */ |
||
120 | public function getData() |
||
124 | |||
125 | /* |
||
126 | * Get Meta data |
||
127 | * @return object |
||
128 | */ |
||
129 | public function getMetaData() |
||
133 | } |
||
134 |