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

[6.x] Sort imports alphabetically on class generation from stub #29951

Merged
merged 1 commit into from
Sep 11, 2019

Conversation

netpok
Copy link
Contributor

@netpok netpok commented Sep 11, 2019

This pull request makes sure that the imports are correctly sorted after generating a class from a stub.

It alphabetically sorts the first use block when it has no whitespace before it (meaning its a file level import), otherwise it does not change the output.

@netpok netpok changed the title Sort imports alphabetically [6.x] Sort imports alphabetically Sep 11, 2019
@netpok netpok changed the title [6.x] Sort imports alphabetically [6.x] Sort imports alphabetically on class generation from stub Sep 11, 2019
@GrahamCampbell
Copy link
Member

Better to update the stubs themselves, maybe?

@taylorotwell taylorotwell merged commit 22acfc5 into laravel:6.x Sep 11, 2019
@netpok netpok deleted the feature/order-imports branch September 11, 2019 17:13
@netpok
Copy link
Contributor Author

netpok commented Sep 11, 2019

@GrahamCampbell This was required because of the "dynamic" imports which are replaced when stubs are compiled to actual classes.

@TBlindaruk
Copy link
Contributor

Is it really necessary? Since stubs, it is just a stub, and you can do the ordering in your class )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants