@@ -24,8 +24,7 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http; |
26 | 26 | |
27 | -interface RequestInterface |
|
28 | -{ |
|
27 | +interface RequestInterface { |
|
29 | 28 | /** |
30 | 29 | * @var string |
31 | 30 | */ |
@@ -24,8 +24,7 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http; |
26 | 26 | |
27 | -interface ResponseInterface |
|
28 | -{ |
|
27 | +interface ResponseInterface { |
|
29 | 28 | /** |
30 | 29 | * @return RequestInterface |
31 | 30 | */ |
@@ -24,6 +24,5 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http\Exception; |
26 | 26 | |
27 | -class AuthorizationException extends RequestException |
|
28 | -{ |
|
27 | +class AuthorizationException extends RequestException { |
|
29 | 28 | } |
@@ -24,13 +24,11 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http\Exception; |
26 | 26 | |
27 | -class EmptyResponseException extends RequestException |
|
28 | -{ |
|
27 | +class EmptyResponseException extends RequestException { |
|
29 | 28 | /** |
30 | 29 | * @param int $status_code |
31 | 30 | */ |
32 | - public function __construct($status_code) |
|
33 | - { |
|
31 | + public function __construct($status_code) { |
|
34 | 32 | parent::__construct(array( |
35 | 33 | 'error' => array( |
36 | 34 | 'message' => 'Empty Response', |
@@ -24,6 +24,5 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http\Exception; |
26 | 26 | |
27 | -class ClientException extends RequestException |
|
28 | -{ |
|
27 | +class ClientException extends RequestException { |
|
29 | 28 | } |
@@ -24,6 +24,5 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http\Exception; |
26 | 26 | |
27 | -class ThrottleException extends RequestException |
|
28 | -{ |
|
27 | +class ThrottleException extends RequestException { |
|
29 | 28 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | use FacebookAds\Exception\Exception; |
28 | 28 | |
29 | -class RequestException extends Exception |
|
30 | -{ |
|
29 | +class RequestException extends Exception { |
|
31 | 30 | /** |
32 | 31 | * @var int Status code for the response causing the exception |
33 | 32 | */ |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | * @param mixed $default |
94 | 93 | * @return mixed |
95 | 94 | */ |
96 | - protected static function idx(array $array, $key, $default = null) |
|
97 | - { |
|
95 | + protected static function idx(array $array, $key, $default = null) { |
|
98 | 96 | return array_key_exists($key, $array) |
99 | 97 | ? $array[$key] |
100 | 98 | : $default; |
@@ -104,8 +102,7 @@ discard block |
||
104 | 102 | * @param array $response_data |
105 | 103 | * @return array |
106 | 104 | */ |
107 | - protected static function getErrorData(array $response_data) |
|
108 | - { |
|
105 | + protected static function getErrorData(array $response_data) { |
|
109 | 106 | $error_data = static::idx($response_data, 'error', array()); |
110 | 107 | |
111 | 108 | return array( |
@@ -130,8 +127,7 @@ discard block |
||
130 | 127 | * @param int $status_code the HTTP response code |
131 | 128 | * @return RequestException |
132 | 129 | */ |
133 | - public static function create(array $response_data, $status_code) |
|
134 | - { |
|
130 | + public static function create(array $response_data, $status_code) { |
|
135 | 131 | $error_data = static::getErrorData($response_data); |
136 | 132 | if (in_array($error_data['error_subcode'], array(458, 459, 460, 463, 464, 467)) |
137 | 133 | || in_array($error_data['code'], array(100, 102, 190)) |
@@ -154,40 +150,35 @@ discard block |
||
154 | 150 | /** |
155 | 151 | * @return int |
156 | 152 | */ |
157 | - public function getHttpStatusCode() |
|
158 | - { |
|
153 | + public function getHttpStatusCode() { |
|
159 | 154 | return $this->statusCode; |
160 | 155 | } |
161 | 156 | |
162 | 157 | /** |
163 | 158 | * @return int|null |
164 | 159 | */ |
165 | - public function getErrorSubcode() |
|
166 | - { |
|
160 | + public function getErrorSubcode() { |
|
167 | 161 | return $this->errorSubcode; |
168 | 162 | } |
169 | 163 | |
170 | 164 | /** |
171 | 165 | * @return string|null |
172 | 166 | */ |
173 | - public function getErrorUserTitle() |
|
174 | - { |
|
167 | + public function getErrorUserTitle() { |
|
175 | 168 | return $this->errorUserTitle; |
176 | 169 | } |
177 | 170 | |
178 | 171 | /** |
179 | 172 | * @return string|null |
180 | 173 | */ |
181 | - public function getErrorUserMessage() |
|
182 | - { |
|
174 | + public function getErrorUserMessage() { |
|
183 | 175 | return $this->errorUserMessage; |
184 | 176 | } |
185 | 177 | |
186 | 178 | /** |
187 | 179 | * @return array|null |
188 | 180 | */ |
189 | - public function getErrorBlameFieldSpecs() |
|
190 | - { |
|
181 | + public function getErrorBlameFieldSpecs() { |
|
191 | 182 | return $this->errorBlameFieldSpecs; |
192 | 183 | } |
193 | 184 | } |
@@ -24,6 +24,5 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http\Exception; |
26 | 26 | |
27 | -class PermissionException extends RequestException |
|
28 | -{ |
|
27 | +class PermissionException extends RequestException { |
|
29 | 28 | } |
@@ -24,6 +24,5 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Http\Exception; |
26 | 26 | |
27 | -class ServerException extends RequestException |
|
28 | -{ |
|
27 | +class ServerException extends RequestException { |
|
29 | 28 | } |