RetentionCleanupCommand.php 695 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\Command;
  8. use OCA\DAV\CalDAV\RetentionService;
  9. use Symfony\Component\Console\Command\Command;
  10. use Symfony\Component\Console\Input\InputInterface;
  11. use Symfony\Component\Console\Output\OutputInterface;
  12. class RetentionCleanupCommand extends Command {
  13. public function __construct(
  14. private RetentionService $service,
  15. ) {
  16. parent::__construct('dav:retention:clean-up');
  17. }
  18. protected function execute(InputInterface $input, OutputInterface $output): int {
  19. $this->service->cleanUp();
  20. return self::SUCCESS;
  21. }
  22. }