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

ordered_imports should not take the braces part in grouped imports into account #5347

Closed
julienfalque opened this issue Dec 9, 2020 · 7 comments · Fixed by #8459
Closed
Labels
kind/enhancement topic/fqcn Fully Qualified Class Name usage and conversions

Comments

@julienfalque
Copy link
Member

Bug report

ordered_imports rule should not take the braces part in grouped imports into account.

Code snippet that reproduces the problem

<?php
use Foo\{Bar, Baz};
use Foo\NotBarNorBar\DeeperClass;

This will be fixed to

<?php
use Foo\NotBarNorBar\DeeperClass;
use Foo\{Bar, Baz};

while it should not be changed because Foo\ comes before Foo\NotBarNorBar\DeeperClass.

Maybe this can be considered an improvement rather than a bug though.

@Wirone Wirone added the status/to verify issue needs to be confirmed or analysed to continue label May 16, 2023
@Wirone Wirone removed the status/to verify issue needs to be confirmed or analysed to continue label Jul 10, 2023
@github-actions

This comment was marked as outdated.

@Wirone Wirone changed the title ordered_imports should not take the braces part in grouped imports into account ordered_imports should not take the braces part in grouped imports into account Oct 28, 2023

This comment was marked as outdated.

@Wirone Wirone added topic/fqcn Fully Qualified Class Name usage and conversions and removed status/stale labels Jan 29, 2024

This comment was marked as outdated.

This comment was marked as outdated.

@wrewolf
Copy link

wrewolf commented Oct 24, 2024

In addition, PhpStorm uses this variation of alpha sorting. And now we have a discrepancy between phpstorm sorting and php-cs-fixer sorting. And there is no way to configure them to work the same way.

Copy link

Since this issue has not had any activity within the last 90 days, I have marked it as stale.

The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way.

You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point.

I will close it if no further activity occurs within the next 30 days.

Copy link

The fact this was automatically closed doesn't mean that the idea got rejected - it simply didn't get any priority for way too long to keep it open. If you are interested in implementing this yourself, please share the implementation draft to align on the approach, before you prepare the full implementation.

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