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: Several improvements for fully_qualified_strict_types (respect declared symbols, relative imports, leading backslash in global namespace) #7679

Merged
merged 27 commits into from Jan 9, 2024

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jan 5, 2024

fix #5199
fix #7642 (and #7677 duplicate)
fix #7680
fix #7686

@Wirone
Copy link
Member

Wirone commented Jan 5, 2024

That's a major refactor, I took a quick look and I am excited about how it works now, but I need more time to wrap my head around it. Anyway, huge work 👏!

Copy link
Member

@Wirone Wirone left a comment

Choose a reason for hiding this comment

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

Ooooffff, that was tough. It's probably not a complete review, but I would like to discuss some things so treat it like an early feedback. I am also kind of open for merging this as-is (after fixing clear problems, obviously) because previously it was also merged in non-optimal form just to provide more coverage. This PR solves so many issues that I think it's worth it even if we would need to continue refactoring later 🙂.

tests/Fixer/Import/FullyQualifiedStrictTypesFixerTest.php Outdated Show resolved Hide resolved
tests/Fixer/Import/FullyQualifiedStrictTypesFixerTest.php Outdated Show resolved Hide resolved
src/Fixer/Import/FullyQualifiedStrictTypesFixer.php Outdated Show resolved Hide resolved
src/Fixer/Import/FullyQualifiedStrictTypesFixer.php Outdated Show resolved Hide resolved
src/Fixer/Import/FullyQualifiedStrictTypesFixer.php Outdated Show resolved Hide resolved
src/Fixer/Import/FullyQualifiedStrictTypesFixer.php Outdated Show resolved Hide resolved
Copy link
Member

@Wirone Wirone left a comment

Choose a reason for hiding this comment

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

I believe this needs to be done, that's why I'm re-marking PR as "changes requested".

Copy link
Member

@Wirone Wirone left a comment

Choose a reason for hiding this comment

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

That's a massive PR 😎!

wawaweewa

@Wirone Wirone changed the title fix: fully_qualified_strict_types must honor implicitly imported short names fix: Several improvements for fully_qualified_strict_types (respect declared symbols, relative imports, leading backslash in global namespace) Jan 9, 2024
@Wirone Wirone enabled auto-merge (squash) January 9, 2024 20:09
@Wirone Wirone merged commit d2906cd into PHP-CS-Fixer:master Jan 9, 2024
25 checks passed
@mvorisek mvorisek deleted the fix_7677 branch January 9, 2024 20:13
@Wirone
Copy link
Member

Wirone commented Jan 9, 2024

Thank you @mvorisek veeeeeeeeeery much for this, huge work 🍻!!

@Wirone Wirone added the topic/fqcn Fully Qualified Class Name usage and conversions label Jan 9, 2024
@mvorisek
Copy link
Contributor Author

mvorisek commented Jan 9, 2024

@Wirone, thank you! ❤

danog pushed a commit to zoonru/PHP-CS-Fixer that referenced this pull request Feb 2, 2024
… declared symbols, relative imports, leading backslash in global namespace) (PHP-CS-Fixer#7679)
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
2 participants