diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-08-23 15:10:27 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-08-25 19:34:58 +0200 |
commit | af6de04e9e141466dc229e444ff3f146f4a34765 (patch) | |
tree | 7b93f521865cdecdadb33637dea33bea242e7969 /apps/files_trashbin/lib/Command | |
parent | 1cc6b3577fdbeadece7e4e6478e7f7755555b41a (diff) | |
download | nextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.tar.gz nextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.zip |
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_trashbin/lib/Command')
-rw-r--r-- | apps/files_trashbin/lib/Command/CleanUp.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Command/ExpireTrash.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Command/RestoreAllFiles.php | 16 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Command/Size.php | 14 |
4 files changed, 18 insertions, 18 deletions
diff --git a/apps/files_trashbin/lib/Command/CleanUp.php b/apps/files_trashbin/lib/Command/CleanUp.php index 405abd3015a..007e97123bf 100644 --- a/apps/files_trashbin/lib/Command/CleanUp.php +++ b/apps/files_trashbin/lib/Command/CleanUp.php @@ -108,11 +108,11 @@ class CleanUp extends Command { $node = $this->rootFolder->get($path); if ($verbose) { - $output->writeln("Deleting <info>" . \OC_Helper::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>."); + $output->writeln('Deleting <info>' . \OC_Helper::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>."); } $node->delete(); if ($this->rootFolder->nodeExists($path)) { - $output->writeln("<error>Trash folder sill exists after attempting to delete it</error>"); + $output->writeln('<error>Trash folder sill exists after attempting to delete it</error>'); return; } $query = $this->dbConnection->getQueryBuilder(); diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index be5bd15d5e6..2c2d9d58539 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -55,7 +55,7 @@ class ExpireTrash extends Command { protected function execute(InputInterface $input, OutputInterface $output): int { $maxAge = $this->expiration->getMaxAgeAsTimestamp(); if (!$maxAge) { - $output->writeln("Auto expiration is configured - keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed)"); + $output->writeln('Auto expiration is configured - keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed)'); return 1; } diff --git a/apps/files_trashbin/lib/Command/RestoreAllFiles.php b/apps/files_trashbin/lib/Command/RestoreAllFiles.php index 103ada3f18f..cd86ede93cb 100644 --- a/apps/files_trashbin/lib/Command/RestoreAllFiles.php +++ b/apps/files_trashbin/lib/Command/RestoreAllFiles.php @@ -167,7 +167,7 @@ class RestoreAllFiles extends Base { $trashCount = count($userTrashItems); if ($trashCount == 0) { - $output->writeln("User has no deleted files in the trashbin matching the given filters"); + $output->writeln('User has no deleted files in the trashbin matching the given filters'); return; } $prepMsg = $dryRun ? 'Would restore' : 'Preparing to restore'; @@ -191,13 +191,13 @@ class RestoreAllFiles extends Base { try { $trashItem->getTrashBackend()->restoreItem($trashItem); } catch (\Throwable $e) { - $output->writeln(" <error>Failed: " . $e->getMessage() . "</error>"); - $output->writeln(" <error>" . $e->getTraceAsString() . "</error>", OutputInterface::VERBOSITY_VERY_VERBOSE); + $output->writeln(' <error>Failed: ' . $e->getMessage() . '</error>'); + $output->writeln(' <error>' . $e->getTraceAsString() . '</error>', OutputInterface::VERBOSITY_VERY_VERBOSE); continue; } $count++; - $output->writeln(" <info>success</info>"); + $output->writeln(' <info>success</info>'); } if (!$dryRun) { @@ -247,7 +247,7 @@ class RestoreAllFiles extends Base { // Check scope with exact class name for locally deleted files if ($scope === self::SCOPE_USER && $trashItemClass !== \OCA\Files_Trashbin\Trash\TrashItem::class) { - $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it is not a user trash item", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping <info>' . $trashItem->getName() . '</info> because it is not a user trash item', OutputInterface::VERBOSITY_VERBOSE); continue; } @@ -257,19 +257,19 @@ class RestoreAllFiles extends Base { * @psalm-suppress RedundantCondition */ if ($scope === self::SCOPE_GROUPFOLDERS && $trashItemClass !== 'OCA\GroupFolders\Trash\GroupTrashItem') { - $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it is not a groupfolders trash item", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping <info>' . $trashItem->getName() . '</info> because it is not a groupfolders trash item', OutputInterface::VERBOSITY_VERBOSE); continue; } // Check left timestamp boundary if ($since !== null && $trashItem->getDeletedTime() <= $since) { - $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it was deleted before the 'since' timestamp", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping <info>' . $trashItem->getName() . "</info> because it was deleted before the 'since' timestamp", OutputInterface::VERBOSITY_VERBOSE); continue; } // Check right timestamp boundary if ($until !== null && $trashItem->getDeletedTime() >= $until) { - $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it was deleted after the 'until' timestamp", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping <info>' . $trashItem->getName() . "</info> because it was deleted after the 'until' timestamp", OutputInterface::VERBOSITY_VERBOSE); continue; } diff --git a/apps/files_trashbin/lib/Command/Size.php b/apps/files_trashbin/lib/Command/Size.php index 6d0e745bf5c..48ee2ced6cb 100644 --- a/apps/files_trashbin/lib/Command/Size.php +++ b/apps/files_trashbin/lib/Command/Size.php @@ -55,7 +55,7 @@ class Size extends Base { if ($size) { $parsedSize = \OC_Helper::computerFileSize($size); if ($parsedSize === false) { - $output->writeln("<error>Failed to parse input size</error>"); + $output->writeln('<error>Failed to parse input size</error>'); return -1; } if ($user) { @@ -63,8 +63,8 @@ class Size extends Base { $this->commandBus->push(new Expire($user)); } else { $this->config->setAppValue('files_trashbin', 'trashbin_size', (string)$parsedSize); - $output->writeln("<info>Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,</info>"); - $output->writeln("<info>a users trashbin can exceed the configured size until they move a new file to the trashbin.</info>"); + $output->writeln('<info>Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,</info>'); + $output->writeln('<info>a users trashbin can exceed the configured size until they move a new file to the trashbin.</info>'); } } else { $this->printTrashbinSize($input, $output, $user); @@ -76,7 +76,7 @@ class Size extends Base { private function printTrashbinSize(InputInterface $input, OutputInterface $output, ?string $user) { $globalSize = (int)$this->config->getAppValue('files_trashbin', 'trashbin_size', '-1'); if ($globalSize < 0) { - $globalHumanSize = "default (50% of available space)"; + $globalHumanSize = 'default (50% of available space)'; } else { $globalHumanSize = \OC_Helper::humanFileSize($globalSize); } @@ -110,14 +110,14 @@ class Size extends Base { if ($input->getOption('output') == self::OUTPUT_FORMAT_PLAIN) { $output->writeln("Default size: $globalHumanSize"); - $output->writeln(""); + $output->writeln(''); if (count($userValues)) { - $output->writeln("Per-user sizes:"); + $output->writeln('Per-user sizes:'); $this->writeArrayInOutputFormat($input, $output, array_map(function ($size) { return \OC_Helper::humanFileSize($size); }, $userValues)); } else { - $output->writeln("No per-user sizes configured"); + $output->writeln('No per-user sizes configured'); } } else { $globalValue = ($globalSize < 0) ? 'default' : $globalSize; |