Passed
Push — master ( d1cb49...2d4b0e )
by Pieter
02:46
created
src/Providers/ApiResourceServiceProvider.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         /**
89 89
          * apie.config: main config
90 90
          */
91
-        $this->app->singleton('apie.config', function () {
91
+        $this->app->singleton('apie.config', function() {
92 92
             $config = $this->app->get('config');
93 93
             $res = ApieConfigResolver::resolveConfig($config->get('apie') ?? []);
94 94
             $config->set('apie', $res);
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
         /**
108 108
          * apie.plugins: array of Apie plugins of the main apie instance.
109 109
          */
110
-        $this->app->singleton('apie.plugins', function () {
110
+        $this->app->singleton('apie.plugins', function() {
111 111
             return $this->getPlugins();
112 112
         });
113 113
 
114 114
         /**
115 115
          * ApieContext::class: get all Apie instances and see which is the current Apie instance.
116 116
          */
117
-        $this->app->singleton(ApieContext::class, function () {
117
+        $this->app->singleton(ApieContext::class, function() {
118 118
             $plugins = $this->app->get('apie.plugins');
119 119
             $debug = (bool) config('app.debug');
120 120
             $config = $this->app->get('apie.config');
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         /**
127 127
          * FileStorageDataLayerContainer::class: creates FileStorageDataLayer for the right Apie instance.
128 128
          */
129
-        $this->app->singleton(FileStorageDataLayerContainer::class, function () {
129
+        $this->app->singleton(FileStorageDataLayerContainer::class, function() {
130 130
             return new FileStorageDataLayerContainer(
131 131
                 storage_path('app/api-file-storage'),
132 132
                 $this->app->get(ApieContext::class)
@@ -166,28 +166,28 @@  discard block
 block discarded – undo
166 166
         /**
167 167
          * ApiResourcesInterface::class: get all resources of the current Apie instance.
168 168
          */
169
-        $this->app->bind(ApiResourcesInterface::class, function () {
169
+        $this->app->bind(ApiResourcesInterface::class, function() {
170 170
             return new ApiResources($this->app->get(Apie::class)->getResources());
171 171
         });
172 172
 
173 173
         /**
174 174
          * ApiResourcePersister: call the correct data layer persist functionality.
175 175
          */
176
-        $this->app->bind(ApiResourcePersister::class, function () {
176
+        $this->app->bind(ApiResourcePersister::class, function() {
177 177
             return new ApiResourcePersister($this->app->get(Apie::class)->getApiResourceMetadataFactory());
178 178
         });
179 179
 
180 180
         /**
181 181
          * ApiResourcePersister: call the correct data layer retrieve functionality.
182 182
          */
183
-        $this->app->bind(ApiResourceRetriever::class, function () {
183
+        $this->app->bind(ApiResourceRetriever::class, function() {
184 184
             return new ApiResourceRetriever($this->app->get(Apie::class)->getApiResourceMetadataFactory());
185 185
         });
186 186
 
187 187
         /**
188 188
          * Apie::class: current Apie instance.
189 189
          */
190
-        $this->app->bind(Apie::class, function () {
190
+        $this->app->bind(Apie::class, function() {
191 191
             /** @var ApieContext $context */
192 192
             $context = $this->app->get(ApieContext::class)->getActiveContext();
193 193
             return $context->getApie();
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         /**
197 197
          * IlluminatePlugin::class: current IlluminatePlugin instance
198 198
          */
199
-        $this->app->bind(IlluminatePlugin::class, function () {
199
+        $this->app->bind(IlluminatePlugin::class, function() {
200 200
             /** @var Apie $apie */
201 201
             $apie = $this->app->get(Apie::class);
202 202
             return $apie->getPlugin(IlluminatePlugin::class);
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         /**
206 206
          * ApplicationInfoRetriever::class: get retriever for Application Info of current apie instance.
207 207
          */
208
-        $this->app->bind(ApplicationInfoRetriever::class, function () {
208
+        $this->app->bind(ApplicationInfoRetriever::class, function() {
209 209
             /** @var IlluminatePlugin $laravelPlugin */
210 210
             $laravelPlugin = $this->app->get(IlluminatePlugin::class);
211 211
             $config = $laravelPlugin->getLaravelConfig();
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
         /**
221 221
          * FileStorageDataLayer::class: get file storage data layer for current apie instance.
222 222
          */
223
-        $this->app->bind(FileStorageDataLayer::class, function () {
223
+        $this->app->bind(FileStorageDataLayer::class, function() {
224 224
             return $this->app->get(FileStorageDataLayerContainer::class)->getCurrentFileStorageDataLayer();
225 225
         });
226 226
 
227 227
         /**
228 228
          * ApieExceptionToResponse::class: converts exception to an Apie response.
229 229
          */
230
-        $this->app->bind(ApieExceptionToResponse::class, function () {
230
+        $this->app->bind(ApieExceptionToResponse::class, function() {
231 231
             /** @var IlluminatePlugin $laravelPlugin */
232 232
             $laravelPlugin = $this->app->get(IlluminatePlugin::class);
233 233
             $config = $laravelPlugin->getLaravelConfig();
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
         /**
239 239
          * Serializer::class: gets the Symfony serializer.
240 240
          */
241
-        $this->app->bind(Serializer::class, function () {
241
+        $this->app->bind(Serializer::class, function() {
242 242
             $serializer = $this->app->get(ResourceSerializerInterface::class);
243
-            if (! ($serializer instanceof SymfonySerializerAdapter)) {
243
+            if (!($serializer instanceof SymfonySerializerAdapter)) {
244 244
                 throw new InvalidClassTypeException('resource serializer', SymfonySerializerAdapter::class);
245 245
             }
246 246
             return $serializer->getSerializer();
@@ -264,18 +264,18 @@  discard block
 block discarded – undo
264 264
 
265 265
     private function registerApieService(string $serviceName, string $methodName)
266 266
     {
267
-        $this->app->bind($serviceName, function () use ($methodName) {
267
+        $this->app->bind($serviceName, function() use ($methodName) {
268 268
             return $this->app->get(Apie::class)->$methodName();
269 269
         });
270 270
     }
271 271
 
272 272
     private function addStatusResourceServices()
273 273
     {
274
-        $this->app->singleton(StatusFromDatabaseRetriever::class, function () {
274
+        $this->app->singleton(StatusFromDatabaseRetriever::class, function() {
275 275
             return new StatusFromDatabaseRetriever(config('app.debug'));
276 276
         });
277 277
         $this->app->tag([StatusFromDatabaseRetriever::class], ['status-check']);
278
-        $this->app->singleton(StatusCheckRetriever::class, function () {
278
+        $this->app->singleton(StatusCheckRetriever::class, function() {
279 279
             return new StatusCheckRetriever($this->app->tagged('status-check'));
280 280
         });
281 281
     }
Please login to merge, or discard this patch.