Passed
Push — develop ( 9f9ae3...7cea29 )
by Pablo
02:27
created
api/controllers/ApiRouter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         self::REQUEST_METHOD_DELETE,
70 70
         self::REQUEST_METHOD_OPTIONS,
71 71
     ];
72
-    const OUTPUT_FORMAT_PATTERN            = '/\.([a-z]*)$/';
72
+    const OUTPUT_FORMAT_PATTERN = '/\.([a-z]*)$/';
73 73
 
74 74
     // --------------------------------------------------------------------------
75 75
 
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
             } catch (ValidationException $e) {
185 185
 
186 186
                 $aOut = [
187
-                    'status'  => $e->getCode() ?: $oHttpCodes::STATUS_BAD_REQUEST,
188
-                    'error'   => $e->getMessage() ?: 'An unkown validation error occurred',
189
-                    'details' => $e->getData() ?: [],
187
+                    'status'  => $e->getCode() ? : $oHttpCodes::STATUS_BAD_REQUEST,
188
+                    'error'   => $e->getMessage() ? : 'An unkown validation error occurred',
189
+                    'details' => $e->getData() ? : [],
190 190
                 ];
191 191
                 if (isSuperuser()) {
192 192
                     $aOut['exception'] = (object) array_filter([
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
             } catch (ApiException $e) {
202 202
 
203 203
                 $aOut = [
204
-                    'status'  => $e->getCode() ?: $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
205
-                    'error'   => $e->getMessage() ?: 'An unkown error occurred',
206
-                    'details' => $e->getData() ?: [],
204
+                    'status'  => $e->getCode() ? : $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
205
+                    'error'   => $e->getMessage() ? : 'An unkown error occurred',
206
+                    'details' => $e->getData() ? : [],
207 207
                 ];
208 208
                 if (isSuperuser()) {
209 209
                     $aOut['exception'] = (object) array_filter([
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
                     throw $e;
227 227
                 } else {
228 228
                     $aOut = [
229
-                        'status'    => $e->getCode() ?: $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
230
-                        'error'     => $e->getMessage() ?: 'An unkown error occurred',
229
+                        'status'    => $e->getCode() ? : $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR,
230
+                        'error'     => $e->getMessage() ? : 'An unkown error occurred',
231 231
                         'exception' => (object) array_filter([
232 232
                             'type' => get_class($e),
233 233
                             'file' => $e->getFile(),
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
     {
275 275
         /** @var Input $oInput */
276 276
         $oInput               = Factory::service('Input');
277
-        $this->sRequestMethod = $oInput->server('REQUEST_METHOD') ?: static::REQUEST_METHOD_GET;
277
+        $this->sRequestMethod = $oInput->server('REQUEST_METHOD') ? : static::REQUEST_METHOD_GET;
278 278
 
279 279
         return $this;
280 280
     }
Please login to merge, or discard this patch.