Merged
Conversation
7ce9640 to
6894d61
Compare
ondrejmirtes
requested changes
Feb 23, 2024
9e8d2b7 to
cda3c21
Compare
mvorisek
reviewed
Feb 23, 2024
| new IdentifierTypeNode('Z'), | ||
| ])), | ||
| new CallableTypeTemplateNode(new IdentifierTypeNode('Ty'), new IdentifierTypeNode('Y')), | ||
| ]), ''), |
Contributor
There was a problem hiding this comment.
https://github.com/phpstan/phpdoc-parser/blob/1.25.0/src/Ast/PhpDoc/TemplateTagValueNode.php#L26 description should be made optional
mvorisek
reviewed
Feb 23, 2024
| new IdentifierTypeNode('C'), | ||
| [ | ||
| new CallableTypeTemplateNode(new IdentifierTypeNode('A'), null), | ||
| new TemplateTagValueNode('A', null, ''), |
Contributor
There was a problem hiding this comment.
I would prefer to change https://github.com/phpstan/phpdoc-parser/blob/1.25.0/src/Ast/PhpDoc/TemplateTagValueNode.php#L15 first to keep IdentifierTypeNode instead of string to allow to store enriched attributes like position in the source phpdoc.
Contributor
Author
There was a problem hiding this comment.
changing TemplateTagValueNode would be a BC break though, and any other solution would require not reusing what already exists
ondrejmirtes
requested changes
Feb 23, 2024
Member
ondrejmirtes
left a comment
There was a problem hiding this comment.
This looks really solid! 👍
cda3c21 to
de6eace
Compare
Member
|
Perfect, thank you! |
This was referenced Feb 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow on from: #199 originally by @mvorisek
MakingTemplateTagParser::parseTemplateTagValue()static seemed like the best approach to fix a circular dependency betweenTypeParserandTemplateTagParser, as it means theTypeParsermust be passed for each call.Also
parseOptionalDescriptionwas awkward to handle as it only needs to be used inPhpDocParserand calls many private functions ofPhpDocParser, so i reworked that to be a callable instead of a boolean flag.