@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function register() |
68 | 68 | { |
69 | - $this->app->singleton('apie.config', function () { |
|
69 | + $this->app->singleton('apie.config', function() { |
|
70 | 70 | $config = $this->app->get('config'); |
71 | 71 | |
72 | 72 | $resolver = new OptionsResolver(); |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | return $resolver->resolve($config->get('apie') ?? []); |
76 | 76 | }); |
77 | 77 | |
78 | - $this->app->singleton(ApiResourcesInterface::class, function () { |
|
78 | + $this->app->singleton(ApiResourcesInterface::class, function() { |
|
79 | 79 | $config = $this->app->get('apie.config'); |
80 | - if (! empty($config['resources-service'])) { |
|
80 | + if (!empty($config['resources-service'])) { |
|
81 | 81 | return $this->app->get($config['resources-service']); |
82 | 82 | } |
83 | 83 | if ($config['resources'] instanceof ApiResourcesInterface) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return new ApiResources($config['resources']); |
87 | 87 | }); |
88 | 88 | |
89 | - $this->app->singleton(ServiceLibraryFactory::class, function () { |
|
89 | + $this->app->singleton(ServiceLibraryFactory::class, function() { |
|
90 | 90 | $config = $this->app->get('apie.config'); |
91 | 91 | $result = new ServiceLibraryFactory( |
92 | 92 | $this->app->get(ApiResourcesInterface::class), |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $result->setSerializerCache(new CacheItemPool($repository)); |
103 | 103 | } |
104 | 104 | } |
105 | - $result->runBeforeInstantiation(function () use (&$result) { |
|
105 | + $result->runBeforeInstantiation(function() use (&$result) { |
|
106 | 106 | $normalizers = [ |
107 | 107 | ]; |
108 | 108 | $taggedNormalizers = $this->app->tagged(NormalizerInterface::class); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | // OpenApiSpecGenerator: generated an OpenAPI 3.0 spec file from a list of resources. |
141 | 141 | $this->addOpenApiServices(); |
142 | - $this->app->singleton(OpenApiSpecGenerator::class, function () { |
|
142 | + $this->app->singleton(OpenApiSpecGenerator::class, function() { |
|
143 | 143 | $config = $this->app->get('apie.config'); |
144 | 144 | $factory = $this->app->get(ServiceLibraryFactory::class); |
145 | 145 | $baseUrl = $config['base-url'] . $config['api-url']; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | }); |
153 | 153 | |
154 | 154 | // SchemaGenerator: generates a OpenAPI Schema from a api resource class. |
155 | - $this->app->singleton(SchemaGenerator::class, function () { |
|
155 | + $this->app->singleton(SchemaGenerator::class, function() { |
|
156 | 156 | $factory = $this->app->get(ServiceLibraryFactory::class); |
157 | 157 | $service = $factory->getSchemaGenerator(); |
158 | 158 | $service->defineSchemaForResource(Uuid::class, new Schema(['type' => 'string', 'format' => 'uuid'])); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | return $service; |
161 | 161 | }); |
162 | 162 | |
163 | - $this->app->singleton(Serializer::class, function () { |
|
163 | + $this->app->singleton(Serializer::class, function() { |
|
164 | 164 | return $this->app->get(ServiceLibraryFactory::class)->getSerializer(); |
165 | 165 | }); |
166 | 166 | $this->app->bind(SerializerInterface::class, Serializer::class); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->app->singleton(CamelCaseToSnakeCaseNameConverter::class); |
170 | 170 | $this->app->bind(NameConverterInterface::class, CamelCaseToSnakeCaseNameConverter::class); |
171 | 171 | |
172 | - $this->app->singleton(ApplicationInfoRetriever::class, function () { |
|
172 | + $this->app->singleton(ApplicationInfoRetriever::class, function() { |
|
173 | 173 | $config = $this->app->get('apie.config'); |
174 | 174 | return new ApplicationInfoRetriever( |
175 | 175 | config('app.name'), |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | }); |
181 | 181 | $this->app->singleton(EloquentModelDataLayer::class); |
182 | 182 | $this->app->singleton(DatabaseQueryRetriever::class); |
183 | - $this->app->singleton(FileStorageDataLayer::class, function () { |
|
183 | + $this->app->singleton(FileStorageDataLayer::class, function() { |
|
184 | 184 | return new FileStorageDataLayer( |
185 | 185 | storage_path('api-file-storage'), |
186 | 186 | $this->app->get(ServiceLibraryFactory::class)->getPropertyAccessor() |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | }); |
189 | 189 | |
190 | 190 | // ApiResourceFacade: class that calls all the right services with a simple interface. |
191 | - $this->app->singleton(ApiResourceFacade::class, function () { |
|
191 | + $this->app->singleton(ApiResourceFacade::class, function() { |
|
192 | 192 | return $this->app->get(ServiceLibraryFactory::class)->getApiResourceFacade(); |
193 | 193 | }); |
194 | 194 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | private function addOpenApiServices() |
205 | 205 | { |
206 | 206 | // Provides contact information to the OpenAPI spec. |
207 | - $this->app->singleton(Contact::class, function () { |
|
207 | + $this->app->singleton(Contact::class, function() { |
|
208 | 208 | $config = $this->app->get('apie.config'); |
209 | 209 | return new Contact([ |
210 | 210 | 'name' => $config['metadata']['contact-name'], |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | }); |
215 | 215 | |
216 | 216 | // Provides license information to the OpenAPI spec. |
217 | - $this->app->singleton(License::class, function () { |
|
217 | + $this->app->singleton(License::class, function() { |
|
218 | 218 | $config = $this->app->get('apie.config'); |
219 | 219 | return new License( |
220 | 220 | $config['metadata']['license'], |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | }); |
224 | 224 | |
225 | 225 | // Provides OpenAPI info to the OpenAPI spec. |
226 | - $this->app->singleton(Info::class, function () { |
|
226 | + $this->app->singleton(Info::class, function() { |
|
227 | 227 | $config = $this->app->get('apie.config'); |
228 | 228 | return new Info( |
229 | 229 | $config['metadata']['title'], |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | |
240 | 240 | private function addStatusResourceServices() |
241 | 241 | { |
242 | - $this->app->singleton(StatusFromDatabaseRetriever::class, function () { |
|
242 | + $this->app->singleton(StatusFromDatabaseRetriever::class, function() { |
|
243 | 243 | return new StatusFromDatabaseRetriever(config('app.debug')); |
244 | 244 | }); |
245 | 245 | $this->app->tag([StatusFromDatabaseRetriever::class], ['status-check']); |
246 | - $this->app->singleton(StatusCheckRetriever::class, function () { |
|
246 | + $this->app->singleton(StatusCheckRetriever::class, function() { |
|
247 | 247 | return new StatusCheckRetriever($this->app->tagged('status-check')); |
248 | 248 | }); |
249 | 249 | } |