@@ -60,23 +60,23 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function register() |
62 | 62 | { |
63 | - $this->app->singleton('apie.config', function () { |
|
63 | + $this->app->singleton('apie.config', function() { |
|
64 | 64 | $config = $this->app->get('config'); |
65 | 65 | return ApieConfigResolver::resolveConfig($config->get('apie') ?? []); |
66 | 66 | }); |
67 | 67 | |
68 | - $this->app->singleton(ApiResourcesInterface::class, function () { |
|
68 | + $this->app->singleton(ApiResourcesInterface::class, function() { |
|
69 | 69 | return new ApiResources($this->app->get(Apie::class)->getResources()); |
70 | 70 | }); |
71 | 71 | |
72 | - $this->app->singleton(Apie::class, function () { |
|
72 | + $this->app->singleton(Apie::class, function() { |
|
73 | 73 | $plugins = $this->app->get('apie.plugins'); |
74 | 74 | $debug = (bool) config('app.debug'); |
75 | 75 | $cacheFolder = storage_path('app/apie-cache'); |
76 | 76 | return DefaultApie::createDefaultApie($debug, $plugins, $cacheFolder, false); |
77 | 77 | }); |
78 | 78 | |
79 | - $this->app->singleton('apie.plugins', function () { |
|
79 | + $this->app->singleton('apie.plugins', function() { |
|
80 | 80 | $plugins = (array) $this->app->tagged(Apie::class); |
81 | 81 | $config = $this->app->get('apie.config'); |
82 | 82 | if (!empty($config['mock'])) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $this->bindApieServices(); |
104 | 104 | |
105 | - $this->app->singleton(ApplicationInfoRetriever::class, function () { |
|
105 | + $this->app->singleton(ApplicationInfoRetriever::class, function() { |
|
106 | 106 | $config = $this->app->get('apie.config'); |
107 | 107 | return new ApplicationInfoRetriever( |
108 | 108 | config('app.name'), |
@@ -111,21 +111,21 @@ discard block |
||
111 | 111 | config('app.debug') |
112 | 112 | ); |
113 | 113 | }); |
114 | - $this->app->singleton(FileStorageDataLayer::class, function () { |
|
114 | + $this->app->singleton(FileStorageDataLayer::class, function() { |
|
115 | 115 | return new FileStorageDataLayer( |
116 | 116 | storage_path('app/api-file-storage'), |
117 | 117 | $this->app->get(Apie::class)->getPropertyAccessor() |
118 | 118 | ); |
119 | 119 | }); |
120 | 120 | |
121 | - $this->app->singleton(ApieExceptionToResponse::class, function () { |
|
121 | + $this->app->singleton(ApieExceptionToResponse::class, function() { |
|
122 | 122 | $mapping = $this->app->get('apie.config')['exception-mapping']; |
123 | 123 | return new ApieExceptionToResponse(resolve(HttpFoundationFactory::class), $mapping); |
124 | 124 | }); |
125 | 125 | |
126 | - $this->app->singleton(Serializer::class, function () { |
|
126 | + $this->app->singleton(Serializer::class, function() { |
|
127 | 127 | $serializer = $this->app->get(ResourceSerializerInterface::class); |
128 | - if (! ($serializer instanceof SymfonySerializerAdapter)) { |
|
128 | + if (!($serializer instanceof SymfonySerializerAdapter)) { |
|
129 | 129 | throw new InvalidClassTypeException('resource serializer', SymfonySerializerAdapter::class); |
130 | 130 | } |
131 | 131 | return $serializer->getSerializer(); |
@@ -151,18 +151,18 @@ discard block |
||
151 | 151 | |
152 | 152 | private function registerApieService(string $serviceName, string $methodName) |
153 | 153 | { |
154 | - $this->app->bind($serviceName, function () use ($methodName) { |
|
154 | + $this->app->bind($serviceName, function() use ($methodName) { |
|
155 | 155 | return $this->app->get(Apie::class)->$methodName(); |
156 | 156 | }); |
157 | 157 | } |
158 | 158 | |
159 | 159 | private function addStatusResourceServices() |
160 | 160 | { |
161 | - $this->app->singleton(StatusFromDatabaseRetriever::class, function () { |
|
161 | + $this->app->singleton(StatusFromDatabaseRetriever::class, function() { |
|
162 | 162 | return new StatusFromDatabaseRetriever(config('app.debug')); |
163 | 163 | }); |
164 | 164 | $this->app->tag([StatusFromDatabaseRetriever::class], ['status-check']); |
165 | - $this->app->singleton(StatusCheckRetriever::class, function () { |
|
165 | + $this->app->singleton(StatusCheckRetriever::class, function() { |
|
166 | 166 | return new StatusCheckRetriever($this->app->tagged('status-check')); |
167 | 167 | }); |
168 | 168 | } |