Skip to content

Commit 12ef1b6

Browse files
Fixed bug that the exit code of command does not work when the exception code isn't int. (#5132)
Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent 88a6f8e commit 12ef1b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
433433
$this->output && $this->error($exception->getMessage());
434434

435435
$this->eventDispatcher->dispatch(new Event\FailToHandle($this, $exception));
436-
return $this->exitCode = $exception->getCode();
436+
return $this->exitCode = (int) $exception->getCode();
437437
} finally {
438438
$this->eventDispatcher && $this->eventDispatcher->dispatch(new Event\AfterExecute($this));
439439
}

0 commit comments

Comments
 (0)