phpdoc-parser
phpdoc-parser copied to clipboard
Method tag is missing return by reference
The MethodTagValue doesn't contain an property returnsReference. This is not a very common option to use but we found a few of them in the wild.
Full blown example will look like this:
/** @method static Type &myMethod() description here */
I will provide a PR later when ready with other things.
Looks like this is much harder than I thought... the type parser consumes the tokens as types. so in my example, the return type will be Type & myMethod which is obviously wrong...
This requires some more time from my side to figure out how to do this. @rvanvelzen any suggestions? Should I use a rollback point to restore and make the type parser consume less in this case? Some look ahead is required here I think.
For reference: https://github.com/phpDocumentor/ReflectionDocBlock/blob/master/src/DocBlock/Tags/Method.php#L125
It's probably best to leave the type parser alone, and with a little bit of hacking I came up with something that should work: https://gist.github.com/rvanvelzen/ff2d187490aa3a810902a4731e350995
Feel free to use it :)