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

[11.x] Mark $queue as nullable #51912

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Jun 26, 2024

The $queue variable passed to the enqueueUsing method may be null when the calling code does not specify a queue to dispatch on, i.e., they want to use the default queue.

class MyJob implements ShouldQueue
{
    use Dispatchable;
}

Event::listen(fn (JobQueued $event) => dump($event->queue));

MyJob::dispatch();

// null

dispatch(function () {
    //
});

// null

@timacdonald timacdonald changed the title [11.x] Mark queue as nullable [11.x] Mark $queue as nullable Jun 26, 2024
@taylorotwell taylorotwell merged commit b677d67 into laravel:11.x Jun 26, 2024
30 checks passed
@timacdonald timacdonald deleted the queue-null branch June 26, 2024 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants