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 | public function __construct(ResponseInterface $response) { |
||
86 | |||
87 | /** |
||
88 | 8 | * @return ResponseInterface|null |
|
89 | 8 | */ |
|
90 | public function getResponse() { |
||
93 | 8 | ||
94 | 8 | /** |
|
95 | 8 | * @param array $array |
|
96 | 8 | * @param string|int $key |
|
97 | 8 | * @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 | 1 | 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 | 8 | */ |
|
133 | 8 | public static function create(ResponseInterface $response) { |
|
157 | 7 | ||
158 | 7 | /** |
|
159 | 7 | * @return int |
|
160 | 7 | */ |
|
161 | 7 | public function getHttpStatusCode() { |
|
164 | 6 | ||
165 | /** |
||
166 | 2 | * @return int|null |
|
167 | 4 | */ |
|
168 | public function getErrorSubcode() { |
||
171 | |||
172 | 1 | /** |
|
173 | 2 | * @return string|null |
|
174 | 2 | */ |
|
175 | public function getErrorUserTitle() { |
||
178 | |||
179 | 1 | /** |
|
180 | * @return string|null |
||
181 | */ |
||
182 | public function getErrorUserMessage() { |
||
185 | |||
186 | 1 | /** |
|
187 | 1 | * @return array|null |
|
188 | */ |
||
189 | public function getErrorBlameFieldSpecs() { |
||
192 | |||
193 | 1 | /** |
|
194 | 1 | * @return bool |
|
195 | */ |
||
196 | public function isTransient() { |
||
207 | } |
||
208 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.