Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some PHPStan errors #161

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ parameters:
paths:
- src
level: 9
checkMissingIterableValueType: false
ignoreErrors:
- '/Cannot call method when\(\) on mixed/'
2 changes: 1 addition & 1 deletion src/TaskHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
9 changes: 4 additions & 5 deletions src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
*/
class Worker extends LaravelWorker
{
public function process($connectionName, $job, WorkerOptions $options)
public function process($connectionName, $job, WorkerOptions $options): void
{
if ($this->supportsAsyncSignals()) {
$this->listenForSignals();

$this->registerTimeoutHandler($job, $options);
}

return parent::process($connectionName, $job, $options);
parent::process($connectionName, $job, $options);
}

public function kill($status = 0, $options = null): void
Expand All @@ -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);
}
}