1 | <?php |
||
12 | class CodebirdResponseParser |
||
13 | { |
||
14 | /** |
||
15 | * @param object $result |
||
16 | * |
||
17 | * @return ApiResponse |
||
18 | * |
||
19 | * @throws TwitterException |
||
20 | */ |
||
21 | 27 | public function parseObject($result) |
|
25 | |||
26 | /** |
||
27 | * @param object $result |
||
28 | * |
||
29 | * @return ApiResponse |
||
30 | * |
||
31 | * @throws TwitterException |
||
32 | */ |
||
33 | 6 | public function parseList($result) |
|
37 | |||
38 | /** |
||
39 | * Handles a twitter API response object |
||
40 | * |
||
41 | * @param object $result |
||
42 | * @param bool $isList |
||
43 | * |
||
44 | * @return ApiResponse |
||
45 | * |
||
46 | * @throws TwitterException |
||
47 | */ |
||
48 | 33 | private function getResponse($result, $isList) |
|
58 | |||
59 | /** |
||
60 | * @param object $result |
||
61 | * |
||
62 | * @throws TwitterException |
||
63 | */ |
||
64 | 33 | private function handleErrors($result) |
|
71 | |||
72 | /** |
||
73 | * @param object $result |
||
74 | * |
||
75 | * @return HttpStatus |
||
76 | * |
||
77 | * @throws TwitterException |
||
78 | */ |
||
79 | 30 | private function getHttpStatus($result) |
|
88 | |||
89 | /** |
||
90 | * @param object $result |
||
91 | * |
||
92 | * @return ApiRate |
||
93 | */ |
||
94 | 27 | private function getRate($result) |
|
106 | |||
107 | /** |
||
108 | * @param object $result |
||
109 | * @param bool $isList |
||
110 | * |
||
111 | * @return object|array|null |
||
112 | */ |
||
113 | 27 | private function getContent($result, $isList) |
|
132 | } |
||
133 |