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

feat: Support for multi-use statements in NamespaceUsesAnalyzer #7814

Merged

Conversation

Wirone
Copy link
Member

@Wirone Wirone commented Feb 4, 2024

The goal of this refactor/enhancement is being able to collect imports also from comma-separated and {}-grouped multi-use statements. I decided to add explicit isInMulti flag, even though "multi" flag could be inferred from start-end chunk indices - I thought it's better, because maybe we can pass these chunk indices even for single symbols in the future.

Change is backward compatible because class is marked as internal, and entry-point for collecting imports has opt-in flag, so all the fixers work exactly the same at this point. I'll create separate PRs that will show how this feature is used in practice.

@coveralls
Copy link

coveralls commented Feb 4, 2024

Coverage Status

coverage: 94.767% (+0.008%) from 94.759%
when pulling 00618e8 on Wirone:codito/namespace-multi-use-analysis
into 60edba3 on PHP-CS-Fixer:master.

@Wirone Wirone enabled auto-merge (squash) February 5, 2024 09:08
@Wirone Wirone merged commit b1ffa8a into PHP-CS-Fixer:master Feb 5, 2024
24 checks passed
@Wirone Wirone deleted the codito/namespace-multi-use-analysis branch February 5, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants