@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return HttpResponse |
85 | 85 | */ |
86 | 86 | public static function success($data = null, $api_code = null, array $placeholders = null, |
87 | - int $http_code = null, int $json_opts = null): HttpResponse |
|
87 | + int $http_code = null, int $json_opts = null): HttpResponse |
|
88 | 88 | { |
89 | 89 | return static::asSuccess($api_code) |
90 | 90 | ->withData($data) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * @return HttpResponse |
113 | 113 | */ |
114 | 114 | public static function error(int $api_code, array $placeholders = null, $data = null, int $http_code = null, |
115 | - int $json_opts = null): HttpResponse |
|
115 | + int $json_opts = null): HttpResponse |
|
116 | 116 | { |
117 | 117 | return static::asError($api_code) |
118 | 118 | ->withPlaceholders($placeholders) |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | public function withHttpCode(int $http_code = null): self |
162 | 162 | { |
163 | 163 | Validator::assertIsType('http_code', $http_code, [Validator::TYPE_INTEGER, |
164 | - Validator::TYPE_NULL]); |
|
164 | + Validator::TYPE_NULL]); |
|
165 | 165 | $this->http_code = $http_code; |
166 | 166 | |
167 | 167 | return $this; |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | public function withData($data = null): self |
176 | 176 | { |
177 | 177 | Validator::assertIsType('data', $data, [Validator::TYPE_ARRAY, |
178 | - Validator::TYPE_OBJECT, |
|
179 | - Validator::TYPE_NULL]); |
|
178 | + Validator::TYPE_OBJECT, |
|
179 | + Validator::TYPE_NULL]); |
|
180 | 180 | $this->data = $data; |
181 | 181 | |
182 | 182 | return $this; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | public function withJsonOptions(int $json_opts = null): self |
191 | 191 | { |
192 | 192 | Validator::assertIsType('json_opts', $json_opts, [Validator::TYPE_INTEGER, |
193 | - Validator::TYPE_NULL]); |
|
193 | + Validator::TYPE_NULL]); |
|
194 | 194 | $this->json_opts = $json_opts; |
195 | 195 | |
196 | 196 | return $this; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | public function withDebugData(array $debug_data = null): self |
205 | 205 | { |
206 | 206 | Validator::assertIsType('$debug_data', $debug_data, [Validator::TYPE_ARRAY, |
207 | - Validator::TYPE_NULL]); |
|
207 | + Validator::TYPE_NULL]); |
|
208 | 208 | $this->debug_data = $debug_data; |
209 | 209 | |
210 | 210 | return $this; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | public function withMessage(string $msg = null): self |
219 | 219 | { |
220 | 220 | Validator::assertIsType('message', $msg, [Validator::TYPE_STRING, |
221 | - Validator::TYPE_NULL]); |
|
221 | + Validator::TYPE_NULL]); |
|
222 | 222 | $this->message = $msg; |
223 | 223 | |
224 | 224 | return $this; |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | * @noinspection PhpTooManyParametersInspection |
306 | 306 | */ |
307 | 307 | protected function make(bool $success, int $api_code, $msg_or_api_code, $data = null, |
308 | - int $http_code = null, array $placeholders = null, array $http_headers = null, |
|
309 | - int $json_opts = null, array $debug_data = null): HttpResponse |
|
308 | + int $http_code = null, array $placeholders = null, array $http_headers = null, |
|
309 | + int $json_opts = null, array $debug_data = null): HttpResponse |
|
310 | 310 | { |
311 | 311 | $http_headers = $http_headers ?? []; |
312 | 312 | $http_code = $http_code ?? ($success ? ResponseBuilder::DEFAULT_HTTP_CODE_OK : ResponseBuilder::DEFAULT_HTTP_CODE_ERROR); |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | * @noinspection PhpTooManyParametersInspection |
346 | 346 | */ |
347 | 347 | protected function buildResponse(bool $success, int $api_code, |
348 | - $msg_or_api_code, array $placeholders = null, |
|
349 | - $data = null, array $debug_data = null): array |
|
348 | + $msg_or_api_code, array $placeholders = null, |
|
349 | + $data = null, array $debug_data = null): array |
|
350 | 350 | { |
351 | 351 | // ensure $data is either @null, array or object of class with configured mapping. |
352 | 352 | $data = (new Converter())->convert($data); |