Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
fogelito committed Sep 4, 2023
1 parent 18d0043 commit ec38203
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Storage/Device/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,10 @@ public function getPartitionTotalSpace(): float
*/
public function getFiles(string $dir): array
{
return $this->listObjects($dir, 9999);
$data = $this->listObjects($dir);
$data['IsTruncated'] = $data['IsTruncated'] === 'true';
$data['KeyCount'] = intval($data['KeyCount']);
return $data;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Storage/S3Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public function testGetFiles()
{
$path = $this->object->getPath('testing/');
$files = $this->object->getFiles($path);
$this->assertEquals('4', $files['KeyCount']);
$this->assertEquals('false', $files['IsTruncated']);
$this->assertEquals(4, $files['KeyCount']);
$this->assertEquals(false, $files['IsTruncated']);
$this->assertIsArray($files['Contents']);

$file = $files['Contents'][0];
Expand Down

0 comments on commit ec38203

Please sign in to comment.