1 | <?php |
||
30 | class RequestException extends Exception { |
||
31 | |||
32 | /** |
||
33 | * @var ResponseInterface|null |
||
34 | */ |
||
35 | protected $response; |
||
36 | |||
37 | /** |
||
38 | * @var int|null |
||
39 | */ |
||
40 | protected $errorCode; |
||
41 | |||
42 | /** |
||
43 | * @var int|null |
||
44 | */ |
||
45 | protected $errorSubcode; |
||
46 | |||
47 | /** |
||
48 | * @var string|null |
||
49 | */ |
||
50 | protected $errorMessage; |
||
51 | |||
52 | /** |
||
53 | * @var string|null |
||
54 | */ |
||
55 | protected $errorUserTitle; |
||
56 | |||
57 | /** |
||
58 | * @var string|null |
||
59 | */ |
||
60 | protected $errorUserMessage; |
||
61 | |||
62 | /** |
||
63 | * @var int|null |
||
64 | */ |
||
65 | protected $errorType; |
||
66 | |||
67 | /** |
||
68 | * @var array|null |
||
69 | */ |
||
70 | protected $errorBlameFieldSpecs; |
||
71 | |||
72 | /** |
||
73 | * @param ResponseInterface $response |
||
74 | */ |
||
75 | 1 | public function __construct(ResponseInterface $response) { |
|
86 | |||
87 | /** |
||
88 | * @return ResponseInterface|null |
||
89 | */ |
||
90 | public function getResponse() { |
||
93 | |||
94 | /** |
||
95 | * @param array $array |
||
96 | * @param string|int $key |
||
97 | * @param mixed $default |
||
98 | * @return mixed |
||
99 | */ |
||
100 | protected static function idx(array $array, $key, $default = null) { |
||
105 | |||
106 | /** |
||
107 | * @param array $response_data |
||
108 | * @return array |
||
109 | */ |
||
110 | protected static function getErrorData(array $response_data) { |
||
126 | |||
127 | /** |
||
128 | * Process an error payload from the Graph API and return the appropriate |
||
129 | * exception subclass. |
||
130 | * @param ResponseInterface $response |
||
131 | * @return RequestException |
||
132 | */ |
||
133 | public static function create(ResponseInterface $response) { |
||
159 | |||
160 | /** |
||
161 | * @return int |
||
162 | */ |
||
163 | public function getHttpStatusCode() { |
||
166 | |||
167 | /** |
||
168 | * @return int|null |
||
169 | */ |
||
170 | public function getErrorSubcode() { |
||
173 | |||
174 | /** |
||
175 | * @return string|null |
||
176 | */ |
||
177 | public function getErrorUserTitle() { |
||
180 | |||
181 | /** |
||
182 | * @return string|null |
||
183 | */ |
||
184 | public function getErrorUserMessage() { |
||
187 | |||
188 | /** |
||
189 | * @return array|null |
||
190 | */ |
||
191 | public function getErrorBlameFieldSpecs() { |
||
194 | |||
195 | /** |
||
196 | * @return bool |
||
197 | */ |
||
198 | public function isTransient() { |
||
209 | } |
||
210 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.