Use trait property promotion in uninitialized props checks #1362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes phpstan/phpstan#7314
Adapted in the same fashion as I started doing this in #1340.Nevermind, I did it differently. I'm still interested in the refactoring of the class / trait separation, but this is not much related to this.But tbh, I don't quite like the separation of class and trait properties/property usage. AFAIK there were at least 2 rules in that previous PR that made problems without the separation. What I'd like to do in a follow-up (or instead here, but this might be bigger, not sure yet) is to not differentiate between class and trait any more, but instead add a "property/method is from trait"-feature and then only use it in those 2 rules to not be annoying. I think it was about private props/methods that were unused and their usage should not be enforced if they're from traits. That might clear things up a bit, but I'm not sure about the details yet.