-
Notifications
You must be signed in to change notification settings - Fork 590
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
Cannot use typed properties in queued listeners #781
Labels
Comments
driesvints
changed the title
[PHP 7.4] Cannot use typed properties in queued listeners
Cannot use typed properties in queued listeners
Dec 9, 2019
We already solved typed properties in laravel/framework with this PR: laravel/framework#30605 Maybe some ideas from it can be reused here. |
@driesvints Any update on this issue? |
Ping @themsaid |
Any update on this? 🙂 |
I've made a PR for that - see #879 |
This was fixed and will be in the next release. Thanks @lucasmichot. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
When using a queued listener, it is impossible to have typed properties declared in that listener's class.
When Telescope is enabled code above will produce an error:
Steps To Reproduce:
Create any queued listener and enable Telescope.
Issue is caused by
ExtractTags::modelsFor()
method:There are possible workarounds:
IMHO developer should not be forced to either not use typed properties or allow null values in properties.
I've got very simple fix for that, but not sure if that is sufficient (probably not). Simply, there should be check if a property has been initialized before it can be accessed (https://wiki.php.net/rfc/typed_properties_v2#reflection):
If proposed solution is acceptable, I can create MR for that.
The text was updated successfully, but these errors were encountered: