@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\slim; |
| 6 | 6 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function setDataOnly($dataOnly = true) |
| 64 | 64 | { |
| 65 | - $this->dataOnly = (bool)$dataOnly; |
|
| 65 | + $this->dataOnly = (bool) $dataOnly; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 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 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\slim; |
| 6 | 6 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | // Mirrors the API request |
| 25 | 25 | $app->get( |
| 26 | - '/return', function () use ($app) { |
|
| 26 | + '/return', function() use ($app) { |
|
| 27 | 27 | |
| 28 | 28 | $app->render( |
| 29 | 29 | 200, |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // Generic error handler |
| 41 | 41 | $app->error( |
| 42 | - function (\Exception $e) use ($app) { |
|
| 42 | + function(\Exception $e) use ($app) { |
|
| 43 | 43 | |
| 44 | 44 | $errorCode = $e->getCode() ?: 500; |
| 45 | 45 | |
| 46 | 46 | // Log error with the same message |
| 47 | - $message = JsonApiMiddleware::_errorType($e->getCode()) . ': ' . $e->getMessage(); |
|
| 48 | - $app->getLog()->error($message . ' in ' . $e->getFile() . ' at line ' . $e->getLine()); |
|
| 47 | + $message = JsonApiMiddleware::_errorType($e->getCode()).': '.$e->getMessage(); |
|
| 48 | + $app->getLog()->error($message.' in '.$e->getFile().' at line '.$e->getLine()); |
|
| 49 | 49 | |
| 50 | 50 | $app->render( |
| 51 | 51 | $errorCode, |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | // Not found handler (invalid routes, invalid method types) |
| 60 | 60 | $app->notFound( |
| 61 | - function () use ($app) { |
|
| 61 | + function() use ($app) { |
|
| 62 | 62 | $app->render( |
| 63 | 63 | 404, |
| 64 | 64 | [ |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // Handle Empty response body |
| 72 | 72 | $app->hook( |
| 73 | - 'slim.after.router', function () use ($app) { |
|
| 73 | + 'slim.after.router', function() use ($app) { |
|
| 74 | 74 | |
| 75 | 75 | // INFO: this will allow download request to flow |
| 76 | 76 | if ($app->response()->header('Content-Type') === 'application/octet-stream') { |