Skip to content

Commit

Permalink
force casting void-return command to integer
Browse files Browse the repository at this point in the history
  • Loading branch information
rizqyhi committed Nov 20, 2023
1 parent e4ee85c commit a8c8f66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ public function run(InputInterface $input, OutputInterface $output): int
*/
protected function execute(InputInterface $input, OutputInterface $output): mixed
{
return $this->fire();
// Symfony 5 removed support of returning null, so we cast the returned value as integer.
// In this case, void-returned fire() method will be casted to 0.
// @see https://github.com/symfony/console/blob/6.3/CHANGELOG.md#500
return (int) $this->fire();
}

/**
Expand Down

0 comments on commit a8c8f66

Please sign in to comment.