diff --git a/framework/core/src/Api/Actions/JsonApiAction.php b/framework/core/src/Api/Actions/JsonApiAction.php index 734fb573a..e5d4b7c6c 100644 --- a/framework/core/src/Api/Actions/JsonApiAction.php +++ b/framework/core/src/Api/Actions/JsonApiAction.php @@ -37,7 +37,9 @@ abstract class JsonApiAction implements ActionInterface protected function json($data = null, $status = 200) { - if ($data === null) $data = new \ArrayObject(); + if ($data === null) { + $data = new \ArrayObject(); + } $data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); diff --git a/framework/core/src/Api/ApiServiceProvider.php b/framework/core/src/Api/ApiServiceProvider.php index 0f6fe8fa4..72dd2109f 100644 --- a/framework/core/src/Api/ApiServiceProvider.php +++ b/framework/core/src/Api/ApiServiceProvider.php @@ -17,7 +17,7 @@ class ApiServiceProvider extends ServiceProvider 'Flarum\Api\ExceptionHandler' ); - $this->app->singleton('Flarum\Http\Router', function() { return new Router(); }); + $this->app->singleton('Flarum\Http\Router'); include __DIR__.'/routes.php'; }