Skip to content

Commit

Permalink
Merge pull request #20 from zeroSal/master
Browse files Browse the repository at this point in the history
Optionally skip folders in listFiles
  • Loading branch information
robregonm authored May 14, 2024
2 parents b484747 + 9903649 commit 23bc890
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ public function listFiles(
Bucket $bucket,
string $startFileName = '',
string $delimiter = '',
int $maxFileCount = 1
int $maxFileCount = 1,
bool $includeFolders = false
): array {
$files = [];

Expand All @@ -411,8 +412,8 @@ public function listFiles(
]);

foreach ($response['files'] as $file) {
if ('/' === substr($file['fileName'], -1, 1)) {
// Omitir directorios
if (!$includeFolders and '/' === substr($file['fileName'], -1, 1)) {
// Skip folders
continue;
}
$files[] = new File($file);
Expand Down

0 comments on commit 23bc890

Please sign in to comment.