/** * @see \Symfony\Component\Console\Command\Command::execute() */ protected function execute(InputInterface $input, OutputInterface $output) { if ($input->getOption('run')) { $event = $input->getOption('run'); $param = ['run' => true, 'event' => $event]; } else { $event = false; $param = ['run' => false, 'event' => '']; } $result = new Cron($this->app, $output); if ($result->execute($param)) { if ($event) { $this->auditLog(__CLASS__, "Cron {$event} job run"); } else { $this->auditLog(__CLASS__, 'Cron run'); } $output->writeln('<info>Cron run!</info>'); } }