addArgument('interval', InputArgument::OPTIONAL, 'The interval for unactive periods', 'P15D'); } protected function execute(InputInterface $input, OutputInterface $output): int { $this->logger->info('['.$this->getName().'] started', [ 'interval' => $input->getArgument('interval'), ]); try { $interval = new \DateInterval($input->getArgument('interval')); } catch (\Exception $e) { $this->logger->error('['.$this->getName().'] bad interval'); throw $e; } $this->remover->remove($interval); $this->logger->info('['.$this->getName().'] end of command'); return Command::SUCCESS; } }