@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | private function getWebAppRoutes() |
100 | 100 | { |
101 | 101 | $controllerNamespace = $this->controllerNamespace; |
102 | - return function () use ($controllerNamespace) { |
|
102 | + return function() use ($controllerNamespace) { |
|
103 | 103 | $this->get('/', $controllerNamespace . 'PublicController:index')->setName('index'); |
104 | 104 | $this->get('/info', $controllerNamespace . 'PublicController:info')->setName('api_info'); |
105 | 105 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $this->group( |
119 | 119 | '/dashboard', |
120 | - function () use ($controllerNamespace) { |
|
120 | + function() use ($controllerNamespace) { |
|
121 | 121 | $this->get('/', $controllerNamespace . 'ApplicationController:index') |
122 | 122 | ->setName('application_index'); |
123 | 123 | $this->get('/show/{id}', $controllerNamespace . 'ApplicationController:show') |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | private function getApiRoutes() |
152 | 152 | { |
153 | 153 | $controllerNamespace = $this->controllerNamespace; |
154 | - return function () use ($controllerNamespace) { |
|
154 | + return function() use ($controllerNamespace) { |
|
155 | 155 | $this->group( |
156 | 156 | '/auth', |
157 | - function () use ($controllerNamespace) { |
|
157 | + function() use ($controllerNamespace) { |
|
158 | 158 | $this->post('/use', $controllerNamespace . 'AuthorizationController:useCode'); |
159 | 159 | $this->post('/generate', $controllerNamespace . 'AuthorizationController:generate'); |
160 | 160 | $this->post('/sync', $controllerNamespace . 'AuthorizationController:sync'); |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | |
165 | 165 | $this->group( |
166 | 166 | '/users', |
167 | - function () use ($controllerNamespace) { |
|
167 | + function() use ($controllerNamespace) { |
|
168 | 168 | $this->post('/auth', $controllerNamespace . 'UserController:auth'); |
169 | 169 | } |
170 | 170 | ); |
171 | 171 | |
172 | 172 | $this->group( |
173 | 173 | '/devices', |
174 | - function () use ($controllerNamespace) { |
|
174 | + function() use ($controllerNamespace) { |
|
175 | 175 | $this->post('/get', $controllerNamespace . 'DeviceController:get'); |
176 | 176 | $this->post('/auth', $controllerNamespace . 'DeviceController:auth'); |
177 | 177 | $this->post('/unauth', $controllerNamespace . 'DeviceController:unAuth'); |
@@ -180,14 +180,14 @@ discard block |
||
180 | 180 | |
181 | 181 | $this->group( |
182 | 182 | '/collections', |
183 | - function () use ($controllerNamespace) { |
|
183 | + function() use ($controllerNamespace) { |
|
184 | 184 | $this->post('/sync', $controllerNamespace . 'CollectionController:sync'); |
185 | 185 | } |
186 | 186 | ); |
187 | 187 | |
188 | 188 | $this->group( |
189 | 189 | '/entities', |
190 | - function () use ($controllerNamespace) { |
|
190 | + function() use ($controllerNamespace) { |
|
191 | 191 | $this->post('/sync', $controllerNamespace . 'EntityController:sync'); |
192 | 192 | $this->post('/history/sync', $controllerNamespace . 'EntityController:historySync'); |
193 | 193 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $this->addServices($container); |
211 | 211 | |
212 | 212 | //add view |
213 | - $container['view'] = function (Container $container) { |
|
213 | + $container['view'] = function(Container $container) { |
|
214 | 214 | $view = new Twig( |
215 | 215 | $container->get(SyncApiApp::SETTINGS_KEY)['template_path'], |
216 | 216 | [ |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | */ |
270 | 270 | private function createNotFoundHandlerClosure(ContainerInterface $container, $apiError) |
271 | 271 | { |
272 | - return function () use ($container, $apiError) { |
|
273 | - return function (ServerRequestInterface $request, ResponseInterface $response) use ($container, $apiError) { |
|
272 | + return function() use ($container, $apiError) { |
|
273 | + return function(ServerRequestInterface $request, ResponseInterface $response) use ($container, $apiError) { |
|
274 | 274 | if ($this->isApiRequest($request)) { |
275 | 275 | $resp = new BaseResponse(); |
276 | 276 | $resp->RequestFailed = true; |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | */ |
292 | 292 | private function createErrorHandlerClosure(ContainerInterface $cont) |
293 | 293 | { |
294 | - return function () use ($cont) { |
|
295 | - return function (ServerRequestInterface $request, ResponseInterface $response, $error = null) use ($cont) { |
|
294 | + return function() use ($cont) { |
|
295 | + return function(ServerRequestInterface $request, ResponseInterface $response, $error = null) use ($cont) { |
|
296 | 296 | if ($error instanceof \Exception || $error instanceof \Throwable) { |
297 | 297 | $errorString = $error->getFile() . ' (' . $error->getLine() . ')\n' . |
298 | 298 | $error->getCode() . ': ' . $error->getMessage() . '\n' . |
@@ -343,19 +343,19 @@ discard block |
||
343 | 343 | */ |
344 | 344 | private function addServices(Container $container) |
345 | 345 | { |
346 | - $container[SyncApiApp::LOGGING_SERVICE_KEY] = function (Container $container) { |
|
346 | + $container[SyncApiApp::LOGGING_SERVICE_KEY] = function(Container $container) { |
|
347 | 347 | return new LoggingService($container); |
348 | 348 | }; |
349 | - $container[SyncApiApp::REQUEST_SERVICE_KEY] = function (Container $container) { |
|
349 | + $container[SyncApiApp::REQUEST_SERVICE_KEY] = function(Container $container) { |
|
350 | 350 | return new RequestService($container); |
351 | 351 | }; |
352 | - $container[SyncApiApp::DATABASE_SERVICE_KEY] = function (Container $container) { |
|
352 | + $container[SyncApiApp::DATABASE_SERVICE_KEY] = function(Container $container) { |
|
353 | 353 | return new DatabaseService($container); |
354 | 354 | }; |
355 | - $container[SyncApiApp::SESSION_SERVICE_KEY] = function (Container $container) { |
|
355 | + $container[SyncApiApp::SESSION_SERVICE_KEY] = function(Container $container) { |
|
356 | 356 | return new SessionService($container); |
357 | 357 | }; |
358 | - $container[SyncApiApp::MAIL_SERVICE_KEY] = function (Container $container) { |
|
358 | + $container[SyncApiApp::MAIL_SERVICE_KEY] = function(Container $container) { |
|
359 | 359 | return new MailService($container); |
360 | 360 | }; |
361 | 361 | } |
@@ -34,8 +34,7 @@ |
||
34 | 34 | { |
35 | 35 | //check if mail settings are defined |
36 | 36 | $mailSettings = isset($this->getSettingsArray()['mail']) ? |
37 | - $this->getSettingsArray()['mail'] : |
|
38 | - ['type' => 'mail']; |
|
37 | + $this->getSettingsArray()['mail'] : ['type' => 'mail']; |
|
39 | 38 | |
40 | 39 | if ($mailSettings['type'] == 'smtp') { |
41 | 40 | $transport = Swift_SmtpTransport::newInstance($mailSettings['url'], $mailSettings['port']) |