@@ -37,7 +37,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -82,7 +82,7 @@ discard block |
||
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,14 +92,14 @@ discard block |
||
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 | return $this->getPlugins(); |
97 | 97 | }); |
98 | 98 | |
99 | 99 | /** |
100 | 100 | * ApieContext::class: get all Apie instances and see which is the current Apie instance. |
101 | 101 | */ |
102 | - $this->app->singleton(ApieContext::class, function () { |
|
102 | + $this->app->singleton(ApieContext::class, function() { |
|
103 | 103 | $plugins = $this->app->get('apie.plugins'); |
104 | 104 | $debug = (bool) config('app.debug'); |
105 | 105 | $config = $this->app->get('apie.config'); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * FileStorageDataLayerContainer::class: creates FileStorageDataLayer for the right Apie instance. |
113 | 113 | */ |
114 | - $this->app->singleton(FileStorageDataLayerContainer::class, function () { |
|
114 | + $this->app->singleton(FileStorageDataLayerContainer::class, function() { |
|
115 | 115 | return new FileStorageDataLayerContainer( |
116 | 116 | storage_path('app/api-file-storage'), |
117 | 117 | $this->app->get(ApieContext::class) |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | /** |
152 | 152 | * ApiResourcesInterface::class: get all resources of the current Apie instance. |
153 | 153 | */ |
154 | - $this->app->bind(ApiResourcesInterface::class, function () { |
|
154 | + $this->app->bind(ApiResourcesInterface::class, function() { |
|
155 | 155 | return new ApiResources($this->app->get(Apie::class)->getResources()); |
156 | 156 | }); |
157 | 157 | |
158 | 158 | /** |
159 | 159 | * Apie::class: current Apie instance. |
160 | 160 | */ |
161 | - $this->app->bind(Apie::class, function () { |
|
161 | + $this->app->bind(Apie::class, function() { |
|
162 | 162 | /** @var ApieContext $context */ |
163 | 163 | $context = $this->app->get(ApieContext::class)->getActiveContext(); |
164 | 164 | return $context->getApie(); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | /** |
168 | 168 | * IlluminatePlugin::class: current IlluminatePlugin instance |
169 | 169 | */ |
170 | - $this->app->bind(IlluminatePlugin::class, function () { |
|
170 | + $this->app->bind(IlluminatePlugin::class, function() { |
|
171 | 171 | /** @var Apie $apie */ |
172 | 172 | $apie = $this->app->get(Apie::class); |
173 | 173 | return $apie->getPlugin(IlluminatePlugin::class); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | /** |
177 | 177 | * ApplicationInfoRetriever::class: get retriever for Application Info of current apie instance. |
178 | 178 | */ |
179 | - $this->app->bind(ApplicationInfoRetriever::class, function () { |
|
179 | + $this->app->bind(ApplicationInfoRetriever::class, function() { |
|
180 | 180 | /** @var IlluminatePlugin $laravelPlugin */ |
181 | 181 | $laravelPlugin = $this->app->get(IlluminatePlugin::class); |
182 | 182 | $config = $laravelPlugin->getLaravelConfig(); |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * FileStorageDataLayer::class: get file storage data layer for current apie instance. |
193 | 193 | */ |
194 | - $this->app->bind(FileStorageDataLayer::class, function () { |
|
194 | + $this->app->bind(FileStorageDataLayer::class, function() { |
|
195 | 195 | return $this->app->get(FileStorageDataLayerContainer::class)->getCurrentFileStorageDataLayer(); |
196 | 196 | }); |
197 | 197 | |
198 | 198 | /** |
199 | 199 | * ApieExceptionToResponse::class: converts exception to an Apie response. |
200 | 200 | */ |
201 | - $this->app->bind(ApieExceptionToResponse::class, function () { |
|
201 | + $this->app->bind(ApieExceptionToResponse::class, function() { |
|
202 | 202 | /** @var IlluminatePlugin $laravelPlugin */ |
203 | 203 | $laravelPlugin = $this->app->get(IlluminatePlugin::class); |
204 | 204 | $config = $laravelPlugin->getLaravelConfig(); |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | /** |
210 | 210 | * Serializer::class: gets the Symfony serializer. |
211 | 211 | */ |
212 | - $this->app->bind(Serializer::class, function () { |
|
212 | + $this->app->bind(Serializer::class, function() { |
|
213 | 213 | $serializer = $this->app->get(ResourceSerializerInterface::class); |
214 | - if (! ($serializer instanceof SymfonySerializerAdapter)) { |
|
214 | + if (!($serializer instanceof SymfonySerializerAdapter)) { |
|
215 | 215 | throw new InvalidClassTypeException('resource serializer', SymfonySerializerAdapter::class); |
216 | 216 | } |
217 | 217 | return $serializer->getSerializer(); |
@@ -233,18 +233,18 @@ discard block |
||
233 | 233 | |
234 | 234 | private function registerApieService(string $serviceName, string $methodName) |
235 | 235 | { |
236 | - $this->app->bind($serviceName, function () use ($methodName) { |
|
236 | + $this->app->bind($serviceName, function() use ($methodName) { |
|
237 | 237 | return $this->app->get(Apie::class)->$methodName(); |
238 | 238 | }); |
239 | 239 | } |
240 | 240 | |
241 | 241 | private function addStatusResourceServices() |
242 | 242 | { |
243 | - $this->app->singleton(StatusFromDatabaseRetriever::class, function () { |
|
243 | + $this->app->singleton(StatusFromDatabaseRetriever::class, function() { |
|
244 | 244 | return new StatusFromDatabaseRetriever(config('app.debug')); |
245 | 245 | }); |
246 | 246 | $this->app->tag([StatusFromDatabaseRetriever::class], ['status-check']); |
247 | - $this->app->singleton(StatusCheckRetriever::class, function () { |
|
247 | + $this->app->singleton(StatusCheckRetriever::class, function() { |
|
248 | 248 | return new StatusCheckRetriever($this->app->tagged('status-check')); |
249 | 249 | }); |
250 | 250 | } |