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

[5.6] FileSystem returns files and directories sorted by name #23387

Merged

Conversation

jamesggordon
Copy link
Contributor

A change made last year to version 5.5 changed the behavior of the FileSystem files() method:

0665f95#diff-3aea724aa0501a58dc0f933de2be07e7

Previously files() would return the list of files in alphabetical order. Since that change, the returned array is no longer sorted alphabetically by name. As the returned object is an array of SplFileSystem objects, sorting the result set in userland isn't as simple as just calling sort(). However, sorting the result set inside the FileSystem class is dead easy.

Many developers may prefer the FileSystem class to return arrays of things sorted by name, as per the original behavior. At the very least it seems like a nice convenience that shouldn't negatively impact anybody who doesn't need this behavior.

@sisve
Copy link
Contributor

sisve commented Mar 5, 2018

Would this need any tests so that it stays this way?

@taylorotwell taylorotwell merged commit c34164f into laravel:5.6 Mar 5, 2018
@GrahamCampbell GrahamCampbell changed the title FileSystem returns files and directories sorted by name [5.6] FileSystem returns files and directories sorted by name Mar 5, 2018
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.

3 participants