phpDocumentor / ReflectionDocBlock

MIT License
9.34k stars 121 forks source link

[DEPRECATION] Usage of static factory methods #361

Open jaapio opened 8 months ago

jaapio commented 8 months ago

Parsing types and variables is becoming more complex these days. Types are evolving faster than the limited time I have to maintain this package while a large number of projects still depends on this library to fully support all kind of type definitions.

To keep up with the ecosystem, it was easier to switch to phpstan/parser to some of the tags. These tags are currently created by a static factory method that contains all the parsing logic for that tag. This has been replaced with a more advanced way of creating those tags using a dedicated factory that can handle the phpstan AST.

I assume that nobody is creating tag object directly, however I cannot be sure. By deprecating the create method in v5 and removing it in v6. There is a more clear migration path for users. If you are using the tags as stand-alone object you should stop doing that and move to the normal docblock factory as shown in the examples.