Abandoned. Supports only PHPParser 3. convert PHPParser\Node to \ast\Node. See https://github.com/TysonAndre/tolerant-php-parser-to-php-ast/ for better error tolerance.
MIT License
1
stars
2
forks
source link
Emulate the way php-ast searches for doc comments for compatibility #11
Only decls should have doc comments bound to them.
One way to emulate this would be to walk the tree post-order before processing, checking the comments attribute of each node, tracking the most recent doc comment.
If a function/method/node/const/property is seen, and doesn't have a doc comment, then add the doc comment. Clear the list of comments tracked so far, and continue traversing.
Only decls should have doc comments bound to them.
One way to emulate this would be to walk the tree post-order before processing, checking the comments attribute of each node, tracking the most recent doc comment.