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

fix: Do not shorten FQN for class resolution if imported symbol is not a class #7705

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Wirone
Copy link
Member

@Wirone Wirone commented Jan 10, 2024

Fixes #7652

@Wirone Wirone added the topic/fqcn Fully Qualified Class Name usage and conversions label Jan 10, 2024
@Wirone Wirone self-assigned this Jan 10, 2024
@mvorisek
Copy link
Contributor

in #7704 there is a fix already :)

Previously all imports in the processed namespace were flattened to one list and use later for shortening. We need to have imports list sliced by import kind, so we can use proper imports in the context of currently processed part of code (e.g. use only class imports when processing function arguments).
@Wirone Wirone marked this pull request as ready for review January 10, 2024 00:21
@Wirone
Copy link
Member Author

Wirone commented Jan 10, 2024

@mvorisek Are you telling me I wasted my time for implementing this 😩? Eeehhhh....

@coveralls
Copy link

Coverage Status

coverage: 94.766% (-0.003%) from 94.769%
when pulling 68491f7 on Wirone:codito/7652-ignore-class-resolution-for-function
into edce2ad on PHP-CS-Fixer:master.

if ($this->cacheUsesLast === $uses) {
return;
}
foreach ($uses as $kind => $kindUses) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the foreach must be put right before the other foreach

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/fqcn Fully Qualified Class Name usage and conversions
Projects
None yet
3 participants