@@ -63,9 +63,9 @@ |
||
63 | 63 | $queryBuilder = $modelClass::where($searchFilterRequest->getSearches()); |
64 | 64 | |
65 | 65 | $modelInstances = $queryBuilder->orderBy('id', 'ASC') |
66 | - ->skip($searchFilterRequest->getOffset()) |
|
67 | - ->take($searchFilterRequest->getNumberOfItems()) |
|
68 | - ->get(); |
|
66 | + ->skip($searchFilterRequest->getOffset()) |
|
67 | + ->take($searchFilterRequest->getNumberOfItems()) |
|
68 | + ->get(); |
|
69 | 69 | |
70 | 70 | return array_filter( |
71 | 71 | array_map( |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function register() |
67 | 67 | { |
68 | - $this->app->singleton('apie.config', function () { |
|
68 | + $this->app->singleton('apie.config', function() { |
|
69 | 69 | $config = $this->app->get('config'); |
70 | 70 | |
71 | 71 | $resolver = new OptionsResolver(); |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | return $resolver->resolve($config->get('apie') ?? []); |
75 | 75 | }); |
76 | 76 | |
77 | - $this->app->singleton(ApiResourcesInterface::class, function () { |
|
77 | + $this->app->singleton(ApiResourcesInterface::class, function() { |
|
78 | 78 | $config = $this->app->get('apie.config'); |
79 | - if (! empty($config['resources-service'])) { |
|
79 | + if (!empty($config['resources-service'])) { |
|
80 | 80 | return $this->app->get($config['resources-service']); |
81 | 81 | } |
82 | 82 | if ($config['resources'] instanceof ApiResourcesInterface) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | return new ApiResources($config['resources']); |
86 | 86 | }); |
87 | 87 | |
88 | - $this->app->singleton(ServiceLibraryFactory::class, function () { |
|
88 | + $this->app->singleton(ServiceLibraryFactory::class, function() { |
|
89 | 89 | $config = $this->app->get('apie.config'); |
90 | 90 | $result = new ServiceLibraryFactory( |
91 | 91 | $this->app->get(ApiResourcesInterface::class), |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | storage_path('apie-cache') |
94 | 94 | ); |
95 | 95 | $result->setContainer($this->app); |
96 | - $result->runBeforeInstantiation(function () use (&$result) { |
|
96 | + $result->runBeforeInstantiation(function() use (&$result) { |
|
97 | 97 | $normalizers = [ |
98 | 98 | ]; |
99 | 99 | $taggedNormalizers = $this->app->tagged(NormalizerInterface::class); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // OpenApiSpecGenerator: generated an OpenAPI 3.0 spec file from a list of resources. |
135 | 135 | $this->addOpenApiServices(); |
136 | - $this->app->singleton(OpenApiSpecGenerator::class, function () { |
|
136 | + $this->app->singleton(OpenApiSpecGenerator::class, function() { |
|
137 | 137 | $config = $this->app->get('apie.config'); |
138 | 138 | $factory = $this->app->get(ServiceLibraryFactory::class); |
139 | 139 | $baseUrl = $config['base-url'] . $config['api-url']; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | }); |
147 | 147 | |
148 | 148 | // SchemaGenerator: generates a OpenAPI Schema from a api resource class. |
149 | - $this->app->singleton(SchemaGenerator::class, function () { |
|
149 | + $this->app->singleton(SchemaGenerator::class, function() { |
|
150 | 150 | $factory = $this->app->get(ServiceLibraryFactory::class); |
151 | 151 | $service = $factory->getSchemaGenerator(); |
152 | 152 | $service->defineSchemaForResource(Uuid::class, new Schema(['type' => 'string', 'format' => 'uuid'])); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | return $service; |
155 | 155 | }); |
156 | 156 | |
157 | - $this->app->singleton(Serializer::class, function () { |
|
157 | + $this->app->singleton(Serializer::class, function() { |
|
158 | 158 | return $this->app->get(ServiceLibraryFactory::class)->getSerializer(); |
159 | 159 | }); |
160 | 160 | $this->app->bind(SerializerInterface::class, Serializer::class); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $this->app->singleton(CamelCaseToSnakeCaseNameConverter::class); |
164 | 164 | $this->app->bind(NameConverterInterface::class, CamelCaseToSnakeCaseNameConverter::class); |
165 | 165 | |
166 | - $this->app->singleton(ApplicationInfoRetriever::class, function () { |
|
166 | + $this->app->singleton(ApplicationInfoRetriever::class, function() { |
|
167 | 167 | $config = $this->app->get('apie.config'); |
168 | 168 | return new ApplicationInfoRetriever( |
169 | 169 | config('app.name'), |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | }); |
175 | 175 | $this->app->singleton(EloquentModelDataLayer::class); |
176 | 176 | $this->app->singleton(DatabaseQueryRetriever::class); |
177 | - $this->app->singleton(FileStorageDataLayer::class, function () { |
|
177 | + $this->app->singleton(FileStorageDataLayer::class, function() { |
|
178 | 178 | return new FileStorageDataLayer( |
179 | 179 | storage_path('api-file-storage'), |
180 | 180 | $this->app->get(ServiceLibraryFactory::class)->getPropertyAccessor() |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | }); |
183 | 183 | |
184 | 184 | // ApiResourceFacade: class that calls all the right services with a simple interface. |
185 | - $this->app->singleton(ApiResourceFacade::class, function () { |
|
185 | + $this->app->singleton(ApiResourceFacade::class, function() { |
|
186 | 186 | return $this->app->get(ServiceLibraryFactory::class)->getApiResourceFacade(); |
187 | 187 | }); |
188 | 188 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | private function addOpenApiServices() |
199 | 199 | { |
200 | 200 | // Provides contact information to the OpenAPI spec. |
201 | - $this->app->singleton(Contact::class, function () { |
|
201 | + $this->app->singleton(Contact::class, function() { |
|
202 | 202 | $config = $this->app->get('apie.config'); |
203 | 203 | return new Contact([ |
204 | 204 | 'name' => $config['metadata']['contact-name'], |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | }); |
209 | 209 | |
210 | 210 | // Provides license information to the OpenAPI spec. |
211 | - $this->app->singleton(License::class, function () { |
|
211 | + $this->app->singleton(License::class, function() { |
|
212 | 212 | $config = $this->app->get('apie.config'); |
213 | 213 | return new License( |
214 | 214 | $config['metadata']['license'], |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | }); |
218 | 218 | |
219 | 219 | // Provides OpenAPI info to the OpenAPI spec. |
220 | - $this->app->singleton(Info::class, function () { |
|
220 | + $this->app->singleton(Info::class, function() { |
|
221 | 221 | $config = $this->app->get('apie.config'); |
222 | 222 | return new Info( |
223 | 223 | $config['metadata']['title'], |
@@ -233,11 +233,11 @@ discard block |
||
233 | 233 | |
234 | 234 | private function addStatusResourceServices() |
235 | 235 | { |
236 | - $this->app->singleton(StatusFromDatabaseRetriever::class, function () { |
|
236 | + $this->app->singleton(StatusFromDatabaseRetriever::class, function() { |
|
237 | 237 | return new StatusFromDatabaseRetriever(config('app.debug')); |
238 | 238 | }); |
239 | 239 | $this->app->tag([StatusFromDatabaseRetriever::class], ['status-check']); |
240 | - $this->app->singleton(StatusCheckRetriever::class, function () { |
|
240 | + $this->app->singleton(StatusCheckRetriever::class, function() { |
|
241 | 241 | return new StatusCheckRetriever($this->app->tagged('status-check')); |
242 | 242 | }); |
243 | 243 | } |