Passed
Push — dev ( c318bc...365386 )
by Marcin
02:44
created
src/ResponseBuilder.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 * @return HttpResponse
154 154
 	 */
155 155
 	public static function success($data = null, $api_code = null, array $placeholders = null,
156
-	                               int $http_code = null, int $json_opts = null): HttpResponse
156
+								   int $http_code = null, int $json_opts = null): HttpResponse
157 157
 	{
158 158
 		return static::buildSuccessResponse($data, $api_code, $placeholders, $http_code, $json_opts);
159 159
 	}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 * @return HttpResponse
171 171
 	 */
172 172
 	public static function successWithCode(int $api_code = null, array $placeholders = null,
173
-	                                       int $http_code = null): HttpResponse
173
+										   int $http_code = null): HttpResponse
174 174
 	{
175 175
 		return static::success(null, $api_code, $placeholders, $http_code);
176 176
 	}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @throws \InvalidArgumentException Thrown when provided arguments are invalid.
206 206
 	 */
207 207
 	protected static function buildSuccessResponse($data = null, int $api_code = null, array $placeholders = null,
208
-	                                               int $http_code = null, int $json_opts = null): HttpResponse
208
+												   int $http_code = null, int $json_opts = null): HttpResponse
209 209
 	{
210 210
 		$http_code = $http_code ?? static::DEFAULT_HTTP_CODE_OK;
211 211
 		$api_code = $api_code ?? BaseApiCodes::OK();
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 * @return HttpResponse
236 236
 	 */
237 237
 	public static function error(int $api_code, array $placeholders = null, $data = null, int $http_code = null,
238
-	                             int $encoding_options = null): HttpResponse
238
+								 int $encoding_options = null): HttpResponse
239 239
 	{
240 240
 		return static::buildErrorResponse($data, $api_code, $http_code, $placeholders, $encoding_options);
241 241
 	}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	 * @return HttpResponse
254 254
 	 */
255 255
 	public static function errorWithData(int $api_code, $data, array $placeholders = null,
256
-	                                     int $json_opts = null): HttpResponse
256
+										 int $json_opts = null): HttpResponse
257 257
 	{
258 258
 		return static::buildErrorResponse($data, $api_code, null, $placeholders, $json_opts);
259 259
 	}
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 * @throws \InvalidArgumentException if http_code is @null
275 275
 	 */
276 276
 	public static function errorWithDataAndHttpCode(int $api_code, $data, int $http_code, array $placeholders = null,
277
-	                                                int $json_opts = null): HttpResponse
277
+													int $json_opts = null): HttpResponse
278 278
 	{
279 279
 		return static::buildErrorResponse($data, $api_code, $http_code, $placeholders, $json_opts);
280 280
 	}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @return HttpResponse
310 310
 	 */
311 311
 	public static function errorWithMessageAndData(int $api_code, string $message, $data,
312
-	                                               int $http_code = null, int $json_opts = null): HttpResponse
312
+												   int $http_code = null, int $json_opts = null): HttpResponse
313 313
 	{
314 314
 		return static::buildErrorResponse($data, $api_code, $http_code, null,
315 315
 			$message, null, $json_opts);
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 	 * @return HttpResponse
331 331
 	 */
332 332
 	public static function errorWithMessageAndDataAndDebug(int $api_code, string $message, $data,
333
-	                                                       int $http_code = null, int $json_opts = null,
334
-	                                                       array $debug_data = null): HttpResponse
333
+														   int $http_code = null, int $json_opts = null,
334
+														   array $debug_data = null): HttpResponse
335 335
 	{
336 336
 		return static::buildErrorResponse($data, $api_code, $http_code, null,
337 337
 			$message, null, $json_opts, $debug_data);
@@ -375,10 +375,10 @@  discard block
 block discarded – undo
375 375
 	 * @noinspection MoreThanThreeArgumentsInspection
376 376
 	 */
377 377
 	protected static function buildErrorResponse($data, int $api_code, int $http_code = null,
378
-	                                             array $placeholders = null,
379
-	                                             string $message = null, array $headers = null,
380
-	                                             int $json_opts = null,
381
-	                                             array $debug_data = null): HttpResponse
378
+												 array $placeholders = null,
379
+												 string $message = null, array $headers = null,
380
+												 int $json_opts = null,
381
+												 array $debug_data = null): HttpResponse
382 382
 	{
383 383
 		$http_code = $http_code ?? static::DEFAULT_HTTP_CODE_ERROR;
384 384
 		$headers = $headers ?? [];
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
 	 * @noinspection MoreThanThreeArgumentsInspection
426 426
 	 */
427 427
 	protected static function make(bool $success, int $api_code, $msg_or_api_code, $data = null,
428
-	                               int $http_code = null, array $placeholders = null, array $headers = null,
429
-	                               int $json_opts = null, array $debug_data = null): HttpResponse
428
+								   int $http_code = null, array $placeholders = null, array $headers = null,
429
+								   int $json_opts = null, array $debug_data = null): HttpResponse
430 430
 	{
431 431
 		$headers = $headers ?? [];
432 432
 		$http_code = $http_code ?? ($success ? static::DEFAULT_HTTP_CODE_OK : static::DEFAULT_HTTP_CODE_ERROR);
@@ -496,8 +496,8 @@  discard block
 block discarded – undo
496 496
 	 * @throws \RuntimeException in case of missing or invalid "classes" mapping configuration
497 497
 	 */
498 498
 	protected static function buildResponse(bool $success, int $api_code,
499
-	                                        $msg_or_api_code, array $placeholders = null,
500
-	                                        $data = null, array $debug_data = null): array
499
+											$msg_or_api_code, array $placeholders = null,
500
+											$data = null, array $debug_data = null): array
501 501
 	{
502 502
 		// ensure $data is either @null, array or object of class with configured mapping.
503 503
 		$converter = new Converter();
Please login to merge, or discard this patch.