doctrine / doctrine/annotations
Build an AST (Abstract syntax tree), before resolving classes and constants?
- Dominant language
- PHP
- Stars
- 6.7k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
Hello there,
every time I looked at the Doctrine annotation discovery (today, and many years ago), it made me wonder: How would I implement an annotation parser?
Currently, `\Doctrine\Common\Annotations\DocParser` does two things at once:
- Parse annotations in the doc comment.
- Resolve class aliases and constants.
This makes the component more complex than it needs to be.
Instead, this could be split up:
- One component to parse the doc comment as an abstract syntax tree.
- A separate component to resolve class aliases and constants.
For absolutely no reason, I am posting a link to my own annotation parser, which follows this philosophy (but does not care about annotation classes).
https://github.com/donquixote/annotation-parser
This entire issue is "food for thought". I currently do not have a personal use case where I would absolutely need this change.
Contributor guide
Assessment
This issue has not been assessed yet.