-
Notifications
You must be signed in to change notification settings - Fork 65
Add assert syntax #120
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
Add assert syntax #120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a nice future addition
@ZebulanStanphill
ZebulanStanphill
May 9, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the current implementation doesn't support class props (e.g. $this->myProp
), or are you only talking about methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any syntax other than plain variables hasn't been implemented yet. It will definitely happen in the future.
I've actually got a more-or-less working implementation with this, but I think allowing more complicated expression (e.g. $this->getSomething()
) isn't too hard and would at least be nice to support here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it'd be nice to have properties and methods too :) Thank you!
BTW @rvanvelzen Did you start working on the counterpart in phpstan-src? If not then I can merge this as it is, get it working in phpstan-src (I have some ideas about that), and we can do methods+properties as follow-up PRs :) What do you think?
I did work on it a bit but feel free to get it working :)
Thank you!
Uh oh!
There was an error while loading. Please reload this page.
Syntax for phpstan/phpstan#7110