Passed
Push — dev ( 3ee8a0...9fe7d1 )
by Marcin
02:37
created
src/ResponseBuilder.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @return HttpResponse
142 142
 	 */
143 143
 	public static function success($data = null, $api_code = null, array $placeholders = null,
144
-	                               int $http_code = null, int $encoding_opts = null): HttpResponse
144
+								   int $http_code = null, int $encoding_opts = null): HttpResponse
145 145
 	{
146 146
 		return static::buildSuccessResponse($data, $api_code, $placeholders, $http_code, $encoding_opts);
147 147
 	}
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @return HttpResponse
159 159
 	 */
160 160
 	public static function successWithCode(int $api_code = null, array $placeholders = null,
161
-	                                       int $http_code = null): HttpResponse
161
+										   int $http_code = null): HttpResponse
162 162
 	{
163 163
 		return static::success(null, $api_code, $placeholders, $http_code);
164 164
 	}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 * @throws \InvalidArgumentException Thrown when provided arguments are invalid.
194 194
 	 */
195 195
 	protected static function buildSuccessResponse($data = null, int $api_code = null, array $placeholders = null,
196
-	                                               int $http_code = null, int $encoding_opts = null): HttpResponse
196
+												   int $http_code = null, int $encoding_opts = null): HttpResponse
197 197
 	{
198 198
 		$http_code = $http_code ?? static::DEFAULT_HTTP_CODE_OK;
199 199
 		$api_code = $api_code ?? BaseApiCodes::OK();
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	 * @return HttpResponse
224 224
 	 */
225 225
 	public static function error(int $api_code, array $placeholders = null, $data = null, int $http_code = null,
226
-	                             int $encoding_options = null): HttpResponse
226
+								 int $encoding_options = null): HttpResponse
227 227
 	{
228 228
 		return static::buildErrorResponse($data, $api_code, $http_code, $placeholders, $encoding_options);
229 229
 	}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 * @return HttpResponse
242 242
 	 */
243 243
 	public static function errorWithData(int $api_code, $data, array $placeholders = null,
244
-	                                     int $encoding_opts = null): HttpResponse
244
+										 int $encoding_opts = null): HttpResponse
245 245
 	{
246 246
 		return static::buildErrorResponse($data, $api_code, null, $placeholders, $encoding_opts);
247 247
 	}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @throws \InvalidArgumentException if http_code is @null
263 263
 	 */
264 264
 	public static function errorWithDataAndHttpCode(int $api_code, $data, int $http_code, array $placeholders = null,
265
-	                                                int $encoding_opts = null): HttpResponse
265
+													int $encoding_opts = null): HttpResponse
266 266
 	{
267 267
 		return static::buildErrorResponse($data, $api_code, $http_code, $placeholders, $encoding_opts);
268 268
 	}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 * @return HttpResponse
297 297
 	 */
298 298
 	public static function errorWithMessageAndData(int $api_code, string $message, $data,
299
-	                                               int $http_code = null, int $encoding_opts = null): HttpResponse
299
+												   int $http_code = null, int $encoding_opts = null): HttpResponse
300 300
 	{
301 301
 		return static::buildErrorResponse($data, $api_code, $http_code, null,
302 302
 			$message, null, $encoding_opts);
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
 	 * @return HttpResponse
318 318
 	 */
319 319
 	public static function errorWithMessageAndDataAndDebug(int $api_code, string $message, $data,
320
-	                                                       int $http_code = null, int $encoding_opts = null,
321
-	                                                       array $debug_data = null): HttpResponse
320
+														   int $http_code = null, int $encoding_opts = null,
321
+														   array $debug_data = null): HttpResponse
322 322
 	{
323 323
 		return static::buildErrorResponse($data, $api_code, $http_code, null,
324 324
 			$message, null, $encoding_opts, $debug_data);
@@ -362,10 +362,10 @@  discard block
 block discarded – undo
362 362
 	 * @noinspection MoreThanThreeArgumentsInspection
363 363
 	 */
364 364
 	protected static function buildErrorResponse($data, int $api_code, int $http_code = null,
365
-	                                             array $placeholders = null,
366
-	                                             string $message = null, array $headers = null,
367
-	                                             int $encoding_opts = null,
368
-	                                             array $debug_data = null): HttpResponse
365
+												 array $placeholders = null,
366
+												 string $message = null, array $headers = null,
367
+												 int $encoding_opts = null,
368
+												 array $debug_data = null): HttpResponse
369 369
 	{
370 370
 		$http_code = $http_code ?? static::DEFAULT_HTTP_CODE_ERROR;
371 371
 		$headers = $headers ?? [];
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
 	 * @noinspection MoreThanThreeArgumentsInspection
413 413
 	 */
414 414
 	protected static function make(bool $success, int $api_code, $msg_or_api_code, $data = null,
415
-	                               int $http_code = null, array $placeholders = null, array $headers = null,
416
-	                               int $encoding_opts = null, array $debug_data = null): HttpResponse
415
+								   int $http_code = null, array $placeholders = null, array $headers = null,
416
+								   int $encoding_opts = null, array $debug_data = null): HttpResponse
417 417
 	{
418 418
 		$headers = $headers ?? [];
419 419
 		$http_code = $http_code ?? ($success ? static::DEFAULT_HTTP_CODE_OK : static::DEFAULT_HTTP_CODE_ERROR);
@@ -481,8 +481,8 @@  discard block
 block discarded – undo
481 481
 	 * @throws \RuntimeException in case of missing or invalid "classes" mapping configuration
482 482
 	 */
483 483
 	protected static function buildResponse(bool $success, int $api_code,
484
-	                                        $msg_or_api_code, array $placeholders = null,
485
-	                                        $data = null, array $debug_data = null): array
484
+											$msg_or_api_code, array $placeholders = null,
485
+											$data = null, array $debug_data = null): array
486 486
 	{
487 487
 		// ensure $data is either @null, array or object of class with configured mapping.
488 488
 		$converter = new Converter();
Please login to merge, or discard this patch.
src/ExceptionHandlerHelper.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 * @return HttpResponse
95 95
 	 */
96 96
 	protected function unauthenticated(/** @scrutinizer ignore-unused */ $request,
97
-	                                                                     AuthenticationException $exception): HttpResponse
97
+																		 AuthenticationException $exception): HttpResponse
98 98
 	{
99 99
 		return static::error($exception, 'authentication_exception', BaseApiCodes::EX_AUTHENTICATION_EXCEPTION());
100 100
 	}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @return HttpResponse
111 111
 	 */
112 112
 	protected static function error(Exception $exception, $exception_config_key, $fallback_api_code,
113
-	                                $fallback_http_code = ResponseBuilder::DEFAULT_HTTP_CODE_ERROR): HttpResponse
113
+									$fallback_http_code = ResponseBuilder::DEFAULT_HTTP_CODE_ERROR): HttpResponse
114 114
 	{
115 115
 		// common prefix for config key
116 116
 		$base_key = sprintf('%s.exception', ResponseBuilder::CONF_EXCEPTION_HANDLER_KEY);
Please login to merge, or discard this patch.