-
Notifications
You must be signed in to change notification settings - Fork 600
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
Error parsing Job class with uninitialized typed properties #1002
Comments
This isn't a Telescope issue. Provide a default value for the property if you aren't setting it when initialising it in your app. |
@driesvints It is absolutely a Telescope issue. Telescope is supposed to be passive and not dictate how my code must be written. Telescope is what was responsible for accessing a variable before it has been initialized, not me. More info on at least one situation where this comes up with Laravel: in Job classes, only the |
@hackel it's not. Please read the stackoverflow link I added above. |
Description:
When a Job class contains typed properties that are not initialized with a default value nor set in the constructor, an error is thrown: "Typed property x must not be accessed before initialization".
I believe to solve this in a backward compatible way, it would require something like this in
Laravel\Telescope\ExtractProperties::from
:Not sure if you would rather return some type of
UninitializedProperty
object instead so that this could actually be distinguished fromnull
in the UI.Steps To Reproduce:
The text was updated successfully, but these errors were encountered: