Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[idea] Refactor to use phpstan/phpdoc-parser #1511

Open
barryvdh opened this issue Feb 7, 2024 · 2 comments
Open

[idea] Refactor to use phpstan/phpdoc-parser #1511

barryvdh opened this issue Feb 7, 2024 · 2 comments

Comments

@barryvdh
Copy link
Owner

barryvdh commented Feb 7, 2024

Just throwing this as a reminder/placeholder.

I came across https://github.com/phpstan/phpdoc-parser which is a zero-requirements package to parse and modify phpdocs.
I've forked https://github.com/barryvdh/ReflectionDocBlock in the past because the original didn't support modifying phpdocs, but it's clearly not so up-to-date.

It would be interesting to see if we can migrate to use that library instead.

@barryvdh
Copy link
Owner Author

barryvdh commented Feb 7, 2024

I think it's not as easy, because that parser doesn't support the context. So you would need something like https://github.com/phpDocumentor/TypeResolver or https://github.com/phpstan/phpstan-src/blob/1.6.x/src/PhpDoc/TypeNodeResolver.php#L160 to resolve the type for us.

Edit: we're already using phpdocumentor/type-resolver so that's not an issue per se

@barryvdh
Copy link
Owner Author

Also something interesting: https://packagist.org/packages/symfony/property-info
For phpdocs we don't really want processing, just want to build it. But for types, we want to use multiple sources (we often already use both reflection, phpdocs and more..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant