🚧 Work on command

This commit is contained in:
Dan Jones 2022-03-03 22:55:57 -06:00
commit 2fb1f346a9
7 changed files with 87 additions and 57 deletions

22
app/Commands/Command.php Normal file
View file

@ -0,0 +1,22 @@
<?php
namespace App\Commands;
use App\Exceptions\Quit;
use LaravelZero\Framework\Commands\Command as BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
abstract class Command extends BaseCommand
{
public function run(InputInterface $input, OutputInterface $output): int
{
try {
return parent::run($input, $output);
} catch (Quit $quit) {
$this->error($quit->getMessage());
return $quit->getCode() > 0 ? $quit->getCode() : 1;
}
}
}