Skip to content

Commit

Permalink
cs:fix
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
  • Loading branch information
julien-nc committed Sep 12, 2024
1 parent f02d2ac commit 02265af
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/BackgroundJob/ImportDropboxJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/StartImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected function configure() {
/**
* Execute the command
*
* @param InputInterface $input
* @param InputInterface $input
* @param OutputInterface $output
*
* @return int
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/DropboxAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]);
}
}
2 changes: 1 addition & 1 deletion lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/DropboxAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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()];
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/DropboxStorageAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
];
Expand Down
4 changes: 2 additions & 2 deletions lib/Settings/AdminSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/Settings/PersonalSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 02265af

Please sign in to comment.