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

report trait access to unititialized property in the trait instead of class #2531

Conversation

schlndh
Copy link
Contributor

@schlndh schlndh commented Jul 14, 2023

There is a bug in how access to uninitialized properties is reported. If the access is in a trait it was reported as being in the class, but the line number was from the trait, so it didn't make sense. This is an attempt to fix it so that the trait access gets reported similarly to other trait issues (i.e. trait (in context of class)).

@schlndh schlndh force-pushed the fix-reportTraitAccessToUninitializedProperties branch from fbf34b6 to 1095687 Compare July 14, 2023 11:35
@schlndh schlndh force-pushed the fix-reportTraitAccessToUninitializedProperties branch from 1095687 to 342c75f Compare July 14, 2023 11:38
@ondrejmirtes
Copy link
Member

Nice, thank you!

@ondrejmirtes ondrejmirtes merged commit 098b0c0 into phpstan:1.10.x Jul 20, 2023
408 checks passed
@schlndh schlndh deleted the fix-reportTraitAccessToUninitializedProperties branch July 20, 2023 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants