diff --git a/lib/BackgroundJob/ImportDropboxJob.php b/lib/BackgroundJob/ImportDropboxJob.php index d322f50..a427827 100644 --- a/lib/BackgroundJob/ImportDropboxJob.php +++ b/lib/BackgroundJob/ImportDropboxJob.php @@ -40,7 +40,7 @@ public function run($argument) { $userId = $argument['user_id']; try { $this->service->importDropboxJob($userId); - } catch(\Exception|\Throwable $e) { + } catch (\Exception|\Throwable $e) { $this->config->setUserValue($userId, Application::APP_ID, 'last_import_error', $e->getMessage()); } } diff --git a/lib/Command/StartImport.php b/lib/Command/StartImport.php index 6bda72e..05b11b9 100644 --- a/lib/Command/StartImport.php +++ b/lib/Command/StartImport.php @@ -29,7 +29,7 @@ protected function configure() { /** * Execute the command * - * @param InputInterface $input + * @param InputInterface $input * @param OutputInterface $output * * @return int diff --git a/lib/Controller/DropboxAPIController.php b/lib/Controller/DropboxAPIController.php index 8154958..66f8d79 100644 --- a/lib/Controller/DropboxAPIController.php +++ b/lib/Controller/DropboxAPIController.php @@ -94,8 +94,8 @@ public function getImportDropboxInformation(): DataResponse { 'last_import_error' => $this->config->getUserValue($this->userId, Application::APP_ID, 'last_import_error', '') !== '', 'dropbox_import_running' => $this->config->getUserValue($this->userId, Application::APP_ID, 'dropbox_import_running') === '1', 'importing_dropbox' => $this->config->getUserValue($this->userId, Application::APP_ID, 'importing_dropbox') === '1', - 'last_dropbox_import_timestamp' => (int) $this->config->getUserValue($this->userId, Application::APP_ID, 'last_dropbox_import_timestamp', '0'), - 'nb_imported_files' => (int) $this->config->getUserValue($this->userId, Application::APP_ID, 'nb_imported_files', '0'), + 'last_dropbox_import_timestamp' => (int)$this->config->getUserValue($this->userId, Application::APP_ID, 'last_dropbox_import_timestamp', '0'), + 'nb_imported_files' => (int)$this->config->getUserValue($this->userId, Application::APP_ID, 'nb_imported_files', '0'), ]); } } diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 942762f..d2b5a94 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -66,7 +66,7 @@ public function prepare(INotification $notification, string $languageCode): INot switch ($notification->getSubject()) { case 'import_dropbox_finished': $p = $notification->getSubjectParameters(); - $nbImported = (int) ($p['nbImported'] ?? 0); + $nbImported = (int)($p['nbImported'] ?? 0); /** @var string $targetPath */ $targetPath = $p['targetPath']; $content = $l->n('%n file was imported from Dropbox storage.', '%n files were imported from Dropbox storage.', $nbImported); diff --git a/lib/Service/DropboxAPIService.php b/lib/Service/DropboxAPIService.php index 7e96afd..e60a870 100644 --- a/lib/Service/DropboxAPIService.php +++ b/lib/Service/DropboxAPIService.php @@ -117,7 +117,7 @@ public function request(string $accessToken, string $refreshToken, string $clien } return json_decode($body, true); } - } catch (ServerException | ClientException $e) { + } catch (ServerException|ClientException $e) { $response = $e->getResponse(); if ($response->getStatusCode() === 401) { $this->logger->info('Trying to REFRESH the access token', ['app' => $this->appName]); @@ -186,7 +186,7 @@ public function downloadFile(string $accessToken, string $refreshToken, string $ } return ['success' => true]; - } catch (ServerException | ClientException $e) { + } catch (ServerException|ClientException $e) { $response = $e->getResponse(); if ($response->getStatusCode() === 401) { if ($try > 3) { @@ -216,7 +216,7 @@ public function downloadFile(string $accessToken, string $refreshToken, string $ } catch (ConnectException $e) { $this->logger->warning('Dropbox API connection error : '.$e->getMessage(), ['app' => $this->appName]); return ['error' => $e->getMessage()]; - } catch (Exception | Throwable $e) { + } catch (Exception|Throwable $e) { $this->logger->warning('Dropbox API connection error : '.$e->getMessage(), ['app' => $this->appName]); return ['error' => $e->getMessage()]; } diff --git a/lib/Service/DropboxStorageAPIService.php b/lib/Service/DropboxStorageAPIService.php index abc5409..c38071d 100644 --- a/lib/Service/DropboxStorageAPIService.php +++ b/lib/Service/DropboxStorageAPIService.php @@ -174,10 +174,10 @@ public function importDropboxJob(string $userId): void { // import by batch of 500 Mo $alreadyImported = $this->config->getUserValue($userId, Application::APP_ID, 'nb_imported_files', '0'); - $alreadyImported = (int) $alreadyImported; + $alreadyImported = (int)$alreadyImported; try { $result = $this->importFiles($accessToken, $refreshToken, $clientID, $clientSecret, $userId, $targetPath, 500000000, $alreadyImported); - } catch (Exception | Throwable $e) { + } catch (Exception|Throwable $e) { $result = [ 'error' => 'Unknow job failure. ' . $e->getMessage(), ]; diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php index e3f9327..bc4d47b 100644 --- a/lib/Settings/AdminSection.php +++ b/lib/Settings/AdminSection.php @@ -35,8 +35,8 @@ public function getName(): string { /** * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. */ public function getPriority(): int { return 80; diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php index 57ea2d9..f24e6f3 100644 --- a/lib/Settings/PersonalSection.php +++ b/lib/Settings/PersonalSection.php @@ -35,8 +35,8 @@ public function getName(): string { /** * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. */ public function getPriority(): int { return 80;