1 | <?php |
||
30 | class RequestException extends Exception { |
||
31 | |||
32 | /** |
||
33 | * @var ResponseInterface|null |
||
34 | */ |
||
35 | protected $response; |
||
36 | |||
37 | /** |
||
38 | * @var int Status code for the response causing the exception |
||
39 | */ |
||
40 | protected $statusCode; |
||
41 | |||
42 | /** |
||
43 | * @var int|null |
||
44 | */ |
||
45 | protected $errorCode; |
||
46 | |||
47 | /** |
||
48 | * @var int|null |
||
49 | */ |
||
50 | protected $errorSubcode; |
||
51 | |||
52 | /** |
||
53 | * @var string|null |
||
54 | */ |
||
55 | protected $errorMessage; |
||
56 | |||
57 | /** |
||
58 | * @var string|null |
||
59 | */ |
||
60 | protected $errorUserTitle; |
||
61 | |||
62 | /** |
||
63 | * @var string|null |
||
64 | */ |
||
65 | protected $errorUserMessage; |
||
66 | |||
67 | /** |
||
68 | * @var int|null |
||
69 | */ |
||
70 | protected $errorType; |
||
71 | |||
72 | /** |
||
73 | * @var array|null |
||
74 | */ |
||
75 | protected $errorBlameFieldSpecs; |
||
76 | |||
77 | /** |
||
78 | * FIXME - v2.6 breaking change: |
||
79 | * make interface __contruct(ResponseInterface $response) |
||
80 | * |
||
81 | * @param array $response_data The response from the Graph API |
||
82 | * @param int $status_code |
||
83 | */ |
||
84 | 8 | public function __construct( |
|
98 | |||
99 | /** |
||
100 | * @return ResponseInterface|null |
||
101 | */ |
||
102 | public function getResponse() { |
||
105 | |||
106 | /** |
||
107 | * @param ResponseInterface $response |
||
108 | * @return $this |
||
109 | */ |
||
110 | 1 | public function setResponse(ResponseInterface $response) { |
|
115 | |||
116 | /** |
||
117 | * @param array $array |
||
118 | * @param string|int $key |
||
119 | * @param mixed $default |
||
120 | * @return mixed |
||
121 | */ |
||
122 | 8 | protected static function idx(array $array, $key, $default = null) { |
|
127 | |||
128 | /** |
||
129 | * @param array $response_data |
||
130 | * @return array |
||
131 | */ |
||
132 | 8 | protected static function getErrorData(array $response_data) { |
|
148 | |||
149 | /** |
||
150 | * Process an error payload from the Graph API and return the appropriate |
||
151 | * exception subclass. |
||
152 | * @param array $response_data the decoded response from the Graph API |
||
153 | * @param int $status_code the HTTP response code |
||
154 | * @return RequestException |
||
155 | */ |
||
156 | 7 | public static function create(array $response_data, $status_code) { |
|
182 | |||
183 | /** |
||
184 | * @return int |
||
185 | */ |
||
186 | 1 | public function getHttpStatusCode() { |
|
189 | |||
190 | /** |
||
191 | * @return int|null |
||
192 | */ |
||
193 | 1 | public function getErrorSubcode() { |
|
196 | |||
197 | /** |
||
198 | * @return string|null |
||
199 | */ |
||
200 | 1 | public function getErrorUserTitle() { |
|
203 | |||
204 | /** |
||
205 | * @return string|null |
||
206 | */ |
||
207 | 1 | public function getErrorUserMessage() { |
|
210 | |||
211 | /** |
||
212 | * @return array|null |
||
213 | */ |
||
214 | 1 | public function getErrorBlameFieldSpecs() { |
|
217 | |||
218 | /** |
||
219 | * @return bool |
||
220 | */ |
||
221 | public function isTransient() { |
||
232 | } |
||
233 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.