/** * Execute the console command. * @throws \Exception */ public function handle() { $id = $this->option('id'); /** @var Commit $commit */ $query = Commit::query(); $query = $query->where('id', '=', $id); $commit = $query->get()->first(); if (empty($commit)) { $this->getOutput()->writeln('<error>Cant find commit:' . $id . '</error>'); return; } $checker = new \App\Ci\Checker\ScheduledChecker(); /** @var OutputStyle $output */ $output = $this->getOutput(); $checker->check($commit, new PsrHandler(new ConsoleLogger($output))); }
/** * Execute the console command * * @return mixed */ public function handle() { /** @var Commit $inProgressCommit */ $inProgressCommit = Commit::query()->where('status', '=', Commit::STATUS_IN_PROGRESS)->get()->first(); if (!empty($inProgressCommit)) { $this->getOutput()->writeln('Already check commit: ' . $inProgressCommit->hash); return; } /** @var Commit $commit */ $commit = Commit::query()->where('status', '=', Commit::STATUS_PENDING)->get()->first(); if (empty($commit)) { $this->getOutput()->writeln('Done'); return; } $checker = new \App\Ci\Checker\ScheduledChecker(); $checker->check($commit); }