Passed
Branch 3.0.0 (66d8c8)
by Pieter
06:03
created
src/Providers/ApiResourceServiceProvider.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         /**
83 83
          * apie.config: main config
84 84
          */
85
-        $this->app->singleton('apie.config', function () {
85
+        $this->app->singleton('apie.config', function() {
86 86
             $config = $this->app->get('config');
87 87
             $res = ApieConfigResolver::resolveConfig($config->get('apie') ?? []);
88 88
             $config->set('apie', $res);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         /**
93 93
          * apie.plugins: array of Apie plugins of the main apie instance.
94 94
          */
95
-        $this->app->singleton('apie.plugins', function () {
95
+        $this->app->singleton('apie.plugins', function() {
96 96
             $plugins = (array) $this->app->tagged(Apie::class);
97 97
             $config = $this->app->get('apie.config');
98 98
             if (!empty($config['mock'])) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         /**
119 119
          * ApieContext::class: get all Apie instances and see which is the current Apie instance.
120 120
          */
121
-        $this->app->singleton(ApieContext::class, function () {
121
+        $this->app->singleton(ApieContext::class, function() {
122 122
             $plugins = $this->app->get('apie.plugins');
123 123
             $debug = (bool) config('app.debug');
124 124
             $config = $this->app->get('apie.config');
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         /**
131 131
          * FileStorageDataLayerContainer::class: creates FileStorageDataLayer for the right Apie instance.
132 132
          */
133
-        $this->app->singleton(FileStorageDataLayerContainer::class, function () {
133
+        $this->app->singleton(FileStorageDataLayerContainer::class, function() {
134 134
             return new FileStorageDataLayerContainer(
135 135
                 storage_path('app/api-file-storage'),
136 136
                 $this->app->get(ApieContext::class)
@@ -143,14 +143,14 @@  discard block
 block discarded – undo
143 143
         /**
144 144
          * ApiResourcesInterface::class: get all resources of the current Apie instance.
145 145
          */
146
-        $this->app->bind(ApiResourcesInterface::class, function () {
146
+        $this->app->bind(ApiResourcesInterface::class, function() {
147 147
             return new ApiResources($this->app->get(Apie::class)->getResources());
148 148
         });
149 149
 
150 150
         /**
151 151
          * Apie::class: current Apie instance.
152 152
          */
153
-        $this->app->bind(Apie::class, function () {
153
+        $this->app->bind(Apie::class, function() {
154 154
             /** @var ApieContext $context */
155 155
             $context = $this->app->get(ApieContext::class)->getActiveContext();
156 156
             return $context->getApie();
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         /**
160 160
          * IlluminatePlugin::class: current IlluminatePlugin instance
161 161
          */
162
-        $this->app->bind(IlluminatePlugin::class, function () {
162
+        $this->app->bind(IlluminatePlugin::class, function() {
163 163
             /** @var Apie $apie */
164 164
             $apie = $this->app->get(Apie::class);
165 165
             return $apie->getPlugin(IlluminatePlugin::class);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         /**
169 169
          * ApplicationInfoRetriever::class: get retriever for Application Info of current apie instance.
170 170
          */
171
-        $this->app->bind(ApplicationInfoRetriever::class, function () {
171
+        $this->app->bind(ApplicationInfoRetriever::class, function() {
172 172
             /** @var IlluminatePlugin $laravelPlugin */
173 173
             $laravelPlugin = $this->app->get(IlluminatePlugin::class);
174 174
             $config = $laravelPlugin->getLaravelConfig();
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
         /**
184 184
          * FileStorageDataLayer::class: get file storage data layer for current apie instance.
185 185
          */
186
-        $this->app->bind(FileStorageDataLayer::class, function () {
186
+        $this->app->bind(FileStorageDataLayer::class, function() {
187 187
             return $this->app->get(FileStorageDataLayerContainer::class)->getCurrentFileStorageDataLayer();
188 188
         });
189 189
 
190 190
         /**
191 191
          * ApieExceptionToResponse::class: converts exception to an Apie response.
192 192
          */
193
-        $this->app->bind(ApieExceptionToResponse::class, function () {
193
+        $this->app->bind(ApieExceptionToResponse::class, function() {
194 194
             /** @var IlluminatePlugin $laravelPlugin */
195 195
             $laravelPlugin = $this->app->get(IlluminatePlugin::class);
196 196
             $config = $laravelPlugin->getLaravelConfig();
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
         /**
202 202
          * Serializer::class: gets the Symfony serializer.
203 203
          */
204
-        $this->app->bind(Serializer::class, function () {
204
+        $this->app->bind(Serializer::class, function() {
205 205
             $serializer = $this->app->get(ResourceSerializerInterface::class);
206
-            if (! ($serializer instanceof SymfonySerializerAdapter)) {
206
+            if (!($serializer instanceof SymfonySerializerAdapter)) {
207 207
                 throw new InvalidClassTypeException('resource serializer', SymfonySerializerAdapter::class);
208 208
             }
209 209
             return $serializer->getSerializer();
@@ -225,18 +225,18 @@  discard block
 block discarded – undo
225 225
 
226 226
     private function registerApieService(string $serviceName, string $methodName)
227 227
     {
228
-        $this->app->bind($serviceName, function () use ($methodName) {
228
+        $this->app->bind($serviceName, function() use ($methodName) {
229 229
             return $this->app->get(Apie::class)->$methodName();
230 230
         });
231 231
     }
232 232
 
233 233
     private function addStatusResourceServices()
234 234
     {
235
-        $this->app->singleton(StatusFromDatabaseRetriever::class, function () {
235
+        $this->app->singleton(StatusFromDatabaseRetriever::class, function() {
236 236
             return new StatusFromDatabaseRetriever(config('app.debug'));
237 237
         });
238 238
         $this->app->tag([StatusFromDatabaseRetriever::class], ['status-check']);
239
-        $this->app->singleton(StatusCheckRetriever::class, function () {
239
+        $this->app->singleton(StatusCheckRetriever::class, function() {
240 240
             return new StatusCheckRetriever($this->app->tagged('status-check'));
241 241
         });
242 242
     }
Please login to merge, or discard this patch.
src/Providers/ApieLaravelServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         // fix for https://github.com/laravel/framework/issues/30415
38 38
         $this->app->extend(
39 39
             ServerRequestInterface::class,
40
-            function (ServerRequestInterface $psrRequest) {
40
+            function(ServerRequestInterface $psrRequest) {
41 41
                 $route = $this->app->make('request')->route();
42 42
                 if ($route) {
43 43
                     $parameters = $route->parameters();
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
         $this->app->bind(
55 55
             SwaggerUiController::class,
56
-            function () {
56
+            function() {
57 57
                 $urlGenerator = $this->app->get(UrlGenerator::class);
58 58
                 return new SwaggerUiController(
59 59
                     $this->app->get(ApieContext::class),
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             }
64 64
         );
65 65
 
66
-        $this->app->bind(ApiResourceFacadeResponse::class, function () {
66
+        $this->app->bind(ApiResourceFacadeResponse::class, function() {
67 67
             /** @var ServerRequestInterface $request */
68 68
             $request = $this->app->get(ServerRequestInterface::class);
69 69
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     public function registerResourceClass(string $resourceClass)
82 82
     {
83
-        $this->app->bind($resourceClass, function () use ($resourceClass) {
83
+        $this->app->bind($resourceClass, function() use ($resourceClass) {
84 84
             /** @var ServerRequestInterface $request */
85 85
             $request = $this->app->get(ServerRequestInterface::class);
86 86
 
Please login to merge, or discard this patch.