countFiles example

protected function configure(): void
    {
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new SymfonyStyle($input$output);

        $context = Context::createDefaultContext();

        $count = $this->deleteExpiredFilesService->countFiles($context);

        if ($count === 0) {
            $io->comment('No expired files found.');

            return self::SUCCESS;
        }

        $confirm = $io->confirm(sprintf('Are you sure that you want to delete %d expired files?', $count), false);

        if (!$confirm) {
            $io->caution('Aborting due to user input.');

            
Home | Imprint | This part of the site doesn't use cookies.