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

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 force-pushed the netpok:feature/order-imports branch from 0c538a5 to 358c5b3 Sep 11, 2019
@netpok netpok force-pushed the netpok:feature/order-imports branch from 358c5b3 to 9dd98ba Sep 11, 2019
@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

This comment has been minimized.

Copy link
Member

commented Sep 11, 2019

Better to update the stubs themselves, maybe?

@taylorotwell taylorotwell merged commit 22acfc5 into laravel:6.x Sep 11, 2019
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@netpok netpok deleted the netpok:feature/order-imports branch Sep 11, 2019
@netpok

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

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

@TBlindaruk

This comment has been minimized.

Copy link
Member

commented Sep 11, 2019

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
Projects
None yet
4 participants
You can’t perform that action at this time.