Skip to content

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented May 29, 2022

Closes phpstan/phpstan#7314

Adapted in the same fashion as I started doing this in #1340.
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.
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.

@herndlm herndlm marked this pull request as ready for review May 29, 2022 13:47
@ondrejmirtes ondrejmirtes merged commit 27f523f into phpstan:1.7.x May 30, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@ondrejmirtes
Copy link
Member

I'm still interested in the refactoring of the class / trait separation

Yeah, if you make it work and it will make more sense than now, why not :)

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.

ReadOnlyPropertyAssignRule is not aware of __construct() method on traits
2 participants