Skip to content
Discussion options

You must be logged in to vote

There is UseImportsResolver service for that

https://github.com/rectorphp/rector-src/blob/89bd84eafaab9ab66a4fcd6a1a4df67d15040732/rules/Naming/Naming/UseImportsResolver.php#L15

For note: If you're using resolveForNode() method for get both Use_ and GroupUse_

you may need to use resolvePrefix() in case for handling with GroupUse_ usage, for example:

https://github.com/rectorphp/rector-src/blob/1a84313089f670496a3313ade850d1650df47741/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php#L112

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tarjei
Comment options

You must be logged in to vote
2 replies
@TomasVotruba
Comment options

@tarjei
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants