Skip to content

Commit

Permalink
Merge pull request #2768 from nextcloud/jr/command-expireGroupBase-types
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin committed Sep 15, 2024
2 parents 2f2086d + 6eb994e commit bb91790
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/Command/ExpireGroup/ExpireGroupBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public function __construct() {
parent::__construct();
}

protected function configure() {
protected function configure(): void {
$this
->setName('groupfolders:expire')
->setDescription('Trigger expiration for files stored in group folders (trash and versions). Currently disabled.');
parent::configure();
}

protected function execute(InputInterface $input, OutputInterface $output) {
protected function execute(InputInterface $input, OutputInterface $output): int {
$output->writeln('<error>groupfolder expiration handling is currently disabled because there is nothing to expire. Enable the "Delete Files" or/and "Versions" app to enable this feature.</error>');
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/ExpireGroup/ExpireGroupTrash.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public function __construct(
$this->expiration = $expiration;
}

protected function configure() {
protected function configure(): void {
$this
->setName('groupfolders:expire')
->setDescription('Trigger expiration of the trashbin for files stored in group folders');
parent::configure();
}

protected function execute(InputInterface $input, OutputInterface $output) {
protected function execute(InputInterface $input, OutputInterface $output): int {
[$count, $size] = $this->trashBackend->expire($this->expiration);
$output->writeln("<info>Removed $count expired trashbin items</info>");
return 0;
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/ExpireGroup/ExpireGroupVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public function __construct(
$this->expireManager = $expireManager;
}

protected function configure() {
protected function configure(): void {
parent::configure();
$this
->setName('groupfolders:expire')
->setDescription('Trigger expiry of versions for files stored in group folders');
}

protected function execute(InputInterface $input, OutputInterface $output) {
protected function execute(InputInterface $input, OutputInterface $output): int {
$this->expireManager->listen(GroupVersionsExpireManager::class, 'enterFolder', function (array $folder) use ($output) {
$output->writeln("<info>Expiring version in '{$folder['mount_point']}'</info>");
});
Expand Down

0 comments on commit bb91790

Please sign in to comment.