From 99036499a442dbaece0450f93a3308863198a450 Mon Sep 17 00:00:00 2001 From: sal Date: Mon, 13 May 2024 10:39:14 +0200 Subject: [PATCH] Optionally skip folders in listFiles --- src/Client.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index fa06b60..0667bc8 100644 --- a/src/Client.php +++ b/src/Client.php @@ -389,7 +389,8 @@ public function listFiles( Bucket $bucket, string $startFileName = '', string $delimiter = '', - int $maxFileCount = 1 + int $maxFileCount = 1, + bool $includeFolders = false ): array { $files = []; @@ -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);