use Shapecode\Bundle\CronBundle\Attribute\AsCronJob;
8
use Symfony\Component\Console\Attribute\AsCommand;
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
use Symfony\Component\Console\Style\SymfonyStyle;
13
14
#[AsCronJob(schedule: '0 0 * * *')]
15
#[AsCommand(name: 'app:user:remove_deleted', description: 'Löscht alle zum Löschen vorgemerkten Benutzer, die vor mehr als 30 Tagen zum Löschen markiert wurden.')]
16
class RemoveDeletedUsers extends Command {
17
private const Modifier = '-30 days';
18
19
public function __construct(private readonly DateHelper $dateHelper, private readonly UserRepositoryInterface $userRepository, string $name = null) {
20
parent::__construct($name);
21
}
22
23
public function execute(InputInterface $input, OutputInterface $output): int {