diff --git a/phpstan.neon b/phpstan.neon index 5af5ae1..33049bd 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,6 +5,3 @@ parameters: paths: - src level: 9 - checkMissingIterableValueType: false - ignoreErrors: - - '/Cannot call method when\(\) on mixed/' diff --git a/src/TaskHandler.php b/src/TaskHandler.php index 812c2b2..29d8416 100644 --- a/src/TaskHandler.php +++ b/src/TaskHandler.php @@ -38,7 +38,7 @@ public function handle(?string $task = null): void // We want to catch any errors so we have more fine-grained control over // how tasks are retried. Cloud Tasks will retry the task if a 5xx status - // is returned. Because we manually manage retries by releaseing jobs, + // is returned. Because we manually manage retries by releasing jobs, // we never want to return a 5xx status as that will result in duplicate // job attempts. rescue(fn () => $this->run($task)); diff --git a/src/Worker.php b/src/Worker.php index f00d85f..ef97065 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -25,7 +25,7 @@ */ class Worker extends LaravelWorker { - public function process($connectionName, $job, WorkerOptions $options) + public function process($connectionName, $job, WorkerOptions $options): void { if ($this->supportsAsyncSignals()) { $this->listenForSignals(); @@ -33,7 +33,7 @@ public function process($connectionName, $job, WorkerOptions $options) $this->registerTimeoutHandler($job, $options); } - return parent::process($connectionName, $job, $options); + parent::process($connectionName, $job, $options); } public function kill($status = 0, $options = null): void @@ -43,10 +43,9 @@ public function kill($status = 0, $options = null): void // When running tests, we cannot run exit because it will kill the PHPunit process. // So, to still test that the application has exited, we will simply rely on the // WorkerStopped event that is fired when the worker is stopped. - if (app()->runningUnitTests()) { - return; + if (! app()->runningUnitTests()) { + exit($status); } - exit($status); } }