phpDocumentor / Reflection

Reflection library to do Static Analysis for PHP Projects
MIT License
117 stars 51 forks source link

Started reworking expression strings into Expression objects #307

Open mvriel opened 1 year ago

mvriel commented 1 year ago

Values of constants, named arguments, etc, should be parsed to include types and FQSENs that can be used in phpDocumentor to display links with. Since these are now simple strings, I have refactored this into a template string system with placeholder values that a consumer could replace with its own values.

TODO:

mvriel commented 1 year ago

As part of checking whether everything works as expected I am adding integration tests, and find out that the pretty printer can be a bit greedy. This is exemplified in the ConstructorPromotionTest where I want to pass a reference to a local class constant, but the ExpressionPrinter picks up on the class reference and does not resolve it.

This is a major issue, and more work is needed to

a) parse the whole FQSEN and use that b) find out how to resolve references, such as self

Another test is needed to see if it resolves relative references as well, as the Standard PrettyPrinter code gives me the idea it does not.