-
Notifications
You must be signed in to change notification settings - Fork 65
Add generic support to @method
definitions
#160
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
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.
And please fix the build failures :)
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.
I feel like this doesn't need a new node, but TemplateTagValueNode can be reused instead. We'd also gain default template types (#148) automatically :)
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 thing should be called $templateTypes
probably.
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 parameter needs to be added as last and needs to be optional, otherwise it's a BC break.
@ondrejmirtes
Thank you for quick reviewing!
I fixed your review comments and build failures.
src/Parser/PhpDocParser.php
Outdated
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.
Could we call the already existing parseTemplateTagValue
?
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.
@ondrejmirtes
I fixed it.
parseTemplateTagValue
also parse description
text, so it was necessary to add the flag parameter $parseDescription
.
This is perfect, thank you very much :) I hope you follow-up with an implementation in phpstan-src :)
I see that this was added in phpdoc-parser over a year ago, but you never followed up with implementing this in phpstan-src. Can you please do? Thanks.
This allows implementing phpstan/phpstan#6371 to add support
@method
generics.