We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ae7104 commit 0c06f3dCopy full SHA for 0c06f3d
packages/queue/src/Job/JobController.php
@@ -230,7 +230,7 @@ public function run(): static
230
return $controller;
231
}
232
233
- public function next(): JobController
+ public function next(): static
234
{
235
if ($this->context !== 'middleware') {
236
throw new \RuntimeException(
@@ -323,6 +323,12 @@ protected function invokeMiddleware(mixed $middleware): mixed
323
);
324
325
326
+ if ($result === null) {
327
+ throw new \UnexpectedValueException(
328
+ 'Middleware returns null, you may forgot to return JobController::next() in middleware.'
329
+ );
330
+ }
331
+
332
if ($result instanceof \Throwable) {
333
throw $result;
334
0 commit comments