Skip to content

Commit 0d1e531

Browse files
committed
Fixed command does not support swow.
1 parent 0307f0f commit 0d1e531

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/Command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
436436
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\BeforeHandle($this));
437437
call([$this, 'handle']);
438438
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\AfterHandle($this));
439-
} catch (ExitException $exception) {
440-
// Do nothing.
441439
} catch (\Throwable $exception) {
440+
if (class_exists(ExitException::class) && $exception instanceof ExitException) {
441+
return 0;
442+
}
443+
442444
if (! $this->eventDispatcher) {
443445
throw $exception;
444446
}

src/Listener/ClearTimerListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public function listen(): array
2626

2727
public function process(object $event)
2828
{
29-
Timer::clearAll();
29+
class_exists(Timer::class) && Timer::clearAll();
3030
}
3131
}

0 commit comments

Comments
 (0)