Skip to content

Commit

Permalink
change Filesystem files() to return similar structured arrays as allF…
Browse files Browse the repository at this point in the history
…iles()
  • Loading branch information
Andrew Huggins committed Apr 19, 2017
1 parent e403d16 commit 0665f95
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/Illuminate/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,20 +372,9 @@ public function glob($pattern, $flags = 0)
* @param string $directory
* @return array
*/
public function files($directory)
public function files($directory, $hidden = false)
{
$glob = glob($directory.'/*');

if ($glob === false) {
return [];
}

// To get the appropriate files, we'll simply glob the directory and filter
// out any "files" that are not truly files so we do not end up with any
// directories in our list, but only true files within the directory.
return array_filter($glob, function ($file) {
return filetype($file) == 'file';
});
return iterator_to_array(Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory)->depth(0), false);
}

/**
Expand Down

0 comments on commit 0665f95

Please sign in to comment.