@@ -204,7 +204,7 @@ |
||
| 204 | 204 | /** |
| 205 | 205 | * @param BaseSyncEntity $syncEntity |
| 206 | 206 | * @param $contentType |
| 207 | - * @return ContentVersion|null |
|
| 207 | + * @return ContentVersion |
|
| 208 | 208 | */ |
| 209 | 209 | private function getActiveVersion(BaseSyncEntity $syncEntity, $contentType) |
| 210 | 210 | { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace Famoser\SyncApi\Models\Communication\Entities\Base; |
| 10 | 10 | |
| 11 | 11 | use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonProperty; |
| 12 | -use Famoser\SyncApi\Framework\Json\Models\DateTimeProperty; |
|
| 13 | 12 | use Famoser\SyncApi\Framework\Json\Models\DateTimeTextProperty; |
| 14 | 13 | use Famoser\SyncApi\Framework\Json\Models\IntProperty; |
| 15 | 14 | use Famoser\SyncApi\Framework\Json\Models\TextProperty; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace Famoser\SyncApi\Models\Communication\Request; |
| 10 | 10 | |
| 11 | 11 | |
| 12 | -use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonProperty; |
|
| 13 | 12 | use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonValueProperty; |
| 14 | 13 | use Famoser\SyncApi\Framework\Json\Models\ObjectProperty; |
| 15 | 14 | use Famoser\SyncApi\Framework\Json\Models\TextProperty; |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | use Famoser\SyncApi\Framework\Json\Models\ArrayProperty; |
| 13 | -use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonProperty; |
|
| 14 | 13 | use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonValueProperty; |
| 15 | 14 | use Famoser\SyncApi\Framework\Json\Models\ObjectProperty; |
| 16 | 15 | use Famoser\SyncApi\Models\Communication\Entities\CollectionCommunicationEntity; |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | use Famoser\SyncApi\Framework\Json\Models\ArrayProperty; |
| 13 | -use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonProperty; |
|
| 14 | 13 | use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonValueProperty; |
| 15 | 14 | use Famoser\SyncApi\Framework\Json\Models\TextProperty; |
| 16 | 15 | use Famoser\SyncApi\Models\Communication\Request\Base\BaseRequest; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace Famoser\SyncApi\Models\Communication\Request; |
| 10 | 10 | |
| 11 | 11 | use Famoser\SyncApi\Framework\Json\Models\ArrayProperty; |
| 12 | -use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonProperty; |
|
| 13 | 12 | use Famoser\SyncApi\Framework\Json\Models\Base\AbstractJsonValueProperty; |
| 14 | 13 | use Famoser\SyncApi\Framework\Json\Models\ObjectProperty; |
| 15 | 14 | use Famoser\SyncApi\Models\Communication\Entities\SyncCommunicationEntity; |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | * @param null|string $where |
| 98 | 98 | * @param null|array $parameters |
| 99 | 99 | * @param null|string $orderBy |
| 100 | - * @return null|Application|ApplicationSetting|AuthorizationCode|Collection|ContentVersion|Device|Entity| |
|
| 100 | + * @return BaseEntity |
|
| 101 | 101 | * FrontendUser|User|UserCollection |
| 102 | 102 | */ |
| 103 | 103 | public function getSingleFromDatabase(BaseEntity $entity, $where = null, $parameters = null, $orderBy = null); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | /** |
| 64 | 64 | * checks if the value to be assigned to a setting is valid |
| 65 | 65 | * |
| 66 | - * @param $key |
|
| 66 | + * @param string $key |
|
| 67 | 67 | * @param $val |
| 68 | 68 | * @return bool |
| 69 | 69 | */ |
@@ -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 | } |