From af6de04e9e141466dc229e444ff3f146f4a34765 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 23 Aug 2024 15:10:27 +0200 Subject: style: update codestyle for coding-standard 1.2.3 Signed-off-by: Daniel Kesselberg --- apps/files_trashbin/lib/Command/CleanUp.php | 4 ++-- apps/files_trashbin/lib/Command/ExpireTrash.php | 2 +- apps/files_trashbin/lib/Command/RestoreAllFiles.php | 16 ++++++++-------- apps/files_trashbin/lib/Command/Size.php | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'apps/files_trashbin/lib/Command') 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 " . \OC_Helper::humanFileSize($node->getSize()) . " in trash for $uid."); + $output->writeln('Deleting ' . \OC_Helper::humanFileSize($node->getSize()) . " in trash for $uid."); } $node->delete(); if ($this->rootFolder->nodeExists($path)) { - $output->writeln("Trash folder sill exists after attempting to delete it"); + $output->writeln('Trash folder sill exists after attempting to delete it'); 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(" Failed: " . $e->getMessage() . ""); - $output->writeln(" " . $e->getTraceAsString() . "", OutputInterface::VERBOSITY_VERY_VERBOSE); + $output->writeln(' Failed: ' . $e->getMessage() . ''); + $output->writeln(' ' . $e->getTraceAsString() . '', OutputInterface::VERBOSITY_VERY_VERBOSE); continue; } $count++; - $output->writeln(" success"); + $output->writeln(' success'); } 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 " . $trashItem->getName() . " because it is not a user trash item", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping ' . $trashItem->getName() . ' 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 " . $trashItem->getName() . " because it is not a groupfolders trash item", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping ' . $trashItem->getName() . ' 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 " . $trashItem->getName() . " because it was deleted before the 'since' timestamp", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping ' . $trashItem->getName() . " 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 " . $trashItem->getName() . " because it was deleted after the 'until' timestamp", OutputInterface::VERBOSITY_VERBOSE); + $output->writeln('Skipping ' . $trashItem->getName() . " 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("Failed to parse input size"); + $output->writeln('Failed to parse input size'); 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("Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,"); - $output->writeln("a users trashbin can exceed the configured size until they move a new file to the trashbin."); + $output->writeln('Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,'); + $output->writeln('a users trashbin can exceed the configured size until they move a new file to the trashbin.'); } } 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; -- cgit v1.2.3