phpstan / phpdoc-parser

Next-gen phpDoc parser with support for intersection types and generics
MIT License
1.31k stars 62 forks source link

Parse generic callable #232

Closed mad-briller closed 6 months ago

mad-briller commented 6 months ago

Follow on from: https://github.com/phpstan/phpdoc-parser/pull/199 originally by @mvorisek

~Making TemplateTagParser::parseTemplateTagValue() static seemed like the best approach to fix a circular dependency between TypeParser and TemplateTagParser, as it means the TypeParser must be passed for each call.~

Also parseOptionalDescription was awkward to handle as it only needs to be used in PhpDocParser and calls many private functions of PhpDocParser, so i reworked that to be a callable instead of a boolean flag.

ondrejmirtes commented 6 months ago

Perfect, thank you!