@@ -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 | } |
@@ -116,7 +116,7 @@ |
||
116 | 116 | $counter = 1; |
117 | 117 | return preg_replace_callback( |
118 | 118 | '/' . preg_quote('*', '/') . '/', |
119 | - function () use (&$counter) { |
|
119 | + function() use (&$counter) { |
|
120 | 120 | $res = '${' . $counter . '}'; |
121 | 121 | $counter++; |
122 | 122 | return $res; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $modelInstances = $builder->get(); |
48 | 48 | |
49 | 49 | return array_map( |
50 | - function ($modelInstance) use (&$resourceClass, &$mapping) { |
|
50 | + function($modelInstance) use (&$resourceClass, &$mapping) { |
|
51 | 51 | return $this->toResource($modelInstance, $resourceClass, $mapping); |
52 | 52 | }, |
53 | 53 | iterator_to_array($modelInstances) |
@@ -20,13 +20,13 @@ |
||
20 | 20 | { |
21 | 21 | if (array_key_exists('collection_resource', $context)) { |
22 | 22 | unset($context['object_to_populate']); |
23 | - return LazyCollection::make(function () use (&$data, &$format, &$context) { |
|
23 | + return LazyCollection::make(function() use (&$data, &$format, &$context) { |
|
24 | 24 | foreach ($data as $key => $value) { |
25 | 25 | yield $key => $this->serializer->denormalize($value, $context['collection_resource'], $format, $context); |
26 | 26 | } |
27 | 27 | }); |
28 | 28 | } |
29 | - return LazyCollection::make(function () use (&$data) { |
|
29 | + return LazyCollection::make(function() use (&$data) { |
|
30 | 30 | yield from $data; |
31 | 31 | }); |
32 | 32 | } |