Completed
Push — master ( 56e3c7...fb6ae9 )
by Lars
14:59
created
src/voku/JsonApiMiddleware.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     $app = Slim::getInstance($slimNameInstance);
21 21
 
22 22
     // Mirrors the API request
23
-    $app->get('/return', function () use ($app) {
23
+    $app->get('/return', function() use ($app) {
24 24
 
25 25
       $app->render(
26 26
           200,
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
 
36 36
     // Generic error handler
37 37
     $app->error(
38
-        function (\Exception $e) use ($app) {
38
+        function(\Exception $e) use ($app) {
39 39
 
40 40
           $errorCode = $e->getCode() ?: 500;
41 41
 
42 42
           // Log error with the same message
43
-          $message = JsonApiMiddleware::_errorType($e->getCode()) . ': ' . $e->getMessage();
44
-          $app->getLog()->error($message . ' in ' . $e->getFile() . ' at line ' . $e->getLine());
43
+          $message = JsonApiMiddleware::_errorType($e->getCode()).': '.$e->getMessage();
44
+          $app->getLog()->error($message.' in '.$e->getFile().' at line '.$e->getLine());
45 45
 
46 46
           $app->render(
47 47
               $errorCode,
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     // Not found handler (invalid routes, invalid method types)
56 56
     $app->notFound(
57
-        function () use ($app) {
57
+        function() use ($app) {
58 58
           $app->render(
59 59
               404,
60 60
               array(
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     );
66 66
 
67 67
     // Handle Empty response body
68
-    $app->hook('slim.after.router', function () use ($app) {
68
+    $app->hook('slim.after.router', function() use ($app) {
69 69
 
70 70
       // INFO: this will allow download request to flow
71 71
       if ($app->response()->header('Content-Type') === 'application/octet-stream') {
Please login to merge, or discard this patch.
src/voku/JsonApiView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
    */
61 61
   public function setDataOnly($dataOnly = true)
62 62
   {
63
-    $this->dataOnly = (bool)$dataOnly;
63
+    $this->dataOnly = (bool) $dataOnly;
64 64
   }
65 65
 
66 66
   /**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
   {
122 122
     $app = Slim::getInstance($slimNameInstance);
123 123
 
124
-    $status = (int)$status;
124
+    $status = (int) $status;
125 125
 
126 126
     if ($this->dataWraper) {
127 127
       $response[$this->dataWraper] = $this->all();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     $jsonp_callback = $app->request->get('callback', null);
181 181
 
182 182
     if ($jsonp_callback !== null) {
183
-      $app->response()->body($jsonp_callback . '(' . UTF8::json_encode($response, $this->encodingOptions) . ')');
183
+      $app->response()->body($jsonp_callback.'('.UTF8::json_encode($response, $this->encodingOptions).')');
184 184
     } else {
185 185
       $app->response()->body(UTF8::json_encode($response, $this->encodingOptions));
186 186
     }
Please login to merge, or discard this patch.