🚧 Work on command
This commit is contained in:
parent
b7f5ee034a
commit
2fb1f346a9
7 changed files with 87 additions and 57 deletions
22
app/Commands/Command.php
Normal file
22
app/Commands/Command.php
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue