Passed
Push — develop ( 44c63c...c491e8 )
by Pablo
02:18
created
api/controllers/ApiRouter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
         'origin',
71 71
         'content-type',
72 72
     ];
73
-    const ACCESS_CONTROL_ALLOW_METHODS     = [
73
+    const ACCESS_CONTROL_ALLOW_METHODS = [
74 74
         self::REQUEST_METHOD_GET,
75 75
         self::REQUEST_METHOD_PUT,
76 76
         self::REQUEST_METHOD_POST,
77 77
         self::REQUEST_METHOD_DELETE,
78 78
         self::REQUEST_METHOD_OPTIONS,
79 79
     ];
80
-    const OUTPUT_FORMAT_PATTERN            = '/\.([a-z]*)$/';
80
+    const OUTPUT_FORMAT_PATTERN = '/\.([a-z]*)$/';
81 81
 
82 82
     // --------------------------------------------------------------------------
83 83
 
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
             } catch (ValidationException $e) {
392 392
 
393 393
                 $aOut = [
394
-                    'status'  => $e->getCode() ?: $oHttpCodes::STATUS_BAD_REQUEST,
395
-                    'error'   => $e->getMessage() ?: 'An unkown validation error occurred',
396
-                    'details' => $e->getData() ?: [],
394
+                    'status'  => $e->getCode() ? : $oHttpCodes::STATUS_BAD_REQUEST,
395
+                    'error'   => $e->getMessage() ? : 'An unkown validation error occurred',
396
+                    'details' => $e->getData() ? : [],
397 397
                 ];
398 398
                 if (isSuperuser()) {
399 399
                     $aOut['exception'] = (object) array_filter([
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
             } catch (ApiException $e) {
409 409
 
410 410
                 $aOut = [
411
-                    'status'  => $e->getCode() ?: $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
412
-                    'error'   => $e->getMessage() ?: 'An unkown error occurred',
413
-                    'details' => $e->getData() ?: [],
411
+                    'status'  => $e->getCode() ? : $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
412
+                    'error'   => $e->getMessage() ? : 'An unkown error occurred',
413
+                    'details' => $e->getData() ? : [],
414 414
                 ];
415 415
                 if (isSuperuser()) {
416 416
                     $aOut['exception'] = (object) array_filter([
@@ -432,8 +432,8 @@  discard block
 block discarded – undo
432 432
                     throw $e;
433 433
                 } else {
434 434
                     $aOut = [
435
-                        'status'    => $e->getCode() ?: $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
436
-                        'error'     => $e->getMessage() ?: 'An unkown error occurred',
435
+                        'status'    => $e->getCode() ? : $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
436
+                        'error'     => $e->getMessage() ? : 'An unkown error occurred',
437 437
                         'exception' => (object) array_filter([
438 438
                             'type' => get_class($e),
439 439
                             'file' => $e->getFile(),
Please login to merge, or discard this patch.