Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
freyo committed Feb 28, 2019
1 parent 2df046a commit 8e8c55d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Adapter.php
Expand Up @@ -271,19 +271,19 @@ public function deleteDir($dirname)
return true;
}

$keys = array_map(function ($item) {
return ['Key' => $item['Key']];
}, (array) $response['Contents']);

// ignore directory
$keys = array_filter($keys, function ($item) {
$keys = array_filter((array) $response['Contents'], function ($item) {
return substr($item['Key'], -1) !== '/';
});

if (empty($keys)) {
return true;
}

$keys = array_map(function ($item) {
return ['Key' => $item['Key']];
}, $keys);

return (bool) $this->client->deleteObjects([
'Bucket' => $this->getBucket(),
'Key' => $keys,
Expand Down

0 comments on commit 8e8c55d

Please sign in to comment.