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
Add different sort algorithm for "uses" - also order by length THEN alpha #3591
Comments
Hi and thanks for opening this issue :) When you state;
do you mean the |
Oh yes my bad, it's not touching those I was under the impression it was. Maybe that's an idea for another option though? To sort the use ones - I just want those ones in alpha order though, not by length (as they are all on one line) |
Thanks for clearing it up, all good 👍 |
@ibrunotome I hope that is fixed in #6181 , you can try by using the latest commit. If not fixed please make a new |
you can use |
You can use https://cs.symfony.com/doc/rules/class_notation/ordered_traits to order the import as So there are a few fixers to check:
I'm going to close this ticket now as it is unclear what is left to do/asked, feel free to make a new issue with a request if something is still lacking. |
"ordered_imports": {"sort_algorithm":"length"} |
When using the
ordered_imports
option, you can only specify onesortAlgorithm
, e.g. length:This results in the following:
Which is correct
however it also sorts the use statements inside the class.However it would be nice if you could specify a different sort order for the "use" statements inside the class - I would like them to be alpha sorted. Ideally there should also be two sort options so it sorts by length THEN alpha.
Maybe something like:
The text was updated successfully, but these errors were encountered: