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

[9.x] Fix Job delay property when dispatched through facade + data_get() closure fix #46582

Closed
wants to merge 5 commits into from

Conversation

bert-w
Copy link
Contributor

@bert-w bert-w commented Mar 24, 2023

Fix for #46568 and an improvement for #46505.

This also includes a helpful improvement for the data_get() global helper, since for PHP 8.0, trying to access properties on a closure (closures are still is_object()) will cause it to error. This PR makes it so that when you now call data_get($closure, 'someProperty'), it will return null (or some other default).

Sadly I couldn't make any tests for the enqueueUsing method to test the correct $delay property, since the method calls a closure further on within the function which is different for each and every Queue driver.

@bert-w bert-w marked this pull request as ready for review March 24, 2023 19:28
@SjorsO
Copy link
Contributor

SjorsO commented Mar 25, 2023

Have you tested that this PR? The enqueueUsing method passes down the delay to the callback, but it seems to me like the callback doesn't actually use that argument, so I have a feeling this fix doesn't work.

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

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

3 participants