diff --git a/src/Storage/Device/S3.php b/src/Storage/Device/S3.php index 1f994862..26522ef8 100644 --- a/src/Storage/Device/S3.php +++ b/src/Storage/Device/S3.php @@ -493,9 +493,11 @@ private function listObjects(string $prefix = '', int $maxKeys = 1000, string $c 'prefix' => $prefix, 'max-keys' => $maxKeys, ]; - if (! empty($continuationToken)) { + + if (!empty($continuationToken)) { $parameters['continuation-token'] = $continuationToken; } + $response = $this->call(self::METHOD_GET, $uri, '', $parameters); return $response->body; diff --git a/tests/Storage/S3Base.php b/tests/Storage/S3Base.php index 4e3531b3..b9228712 100644 --- a/tests/Storage/S3Base.php +++ b/tests/Storage/S3Base.php @@ -83,14 +83,14 @@ public function testGetFilesPagination() $this->assertEquals(3, $files['MaxKeys']); $this->assertEquals(true, $files['IsTruncated']); $this->assertIsArray($files['Contents']); - $this->assertNotEmpty($files['NextContinuationToken']); + $this->assertArrayHasKey('NextContinuationToken', $files); $files = $this->object->getFiles($path, 1000, $files['NextContinuationToken']); $this->assertEquals(1, $files['KeyCount']); $this->assertEquals(1000, $files['MaxKeys']); $this->assertEquals(false, $files['IsTruncated']); $this->assertIsArray($files['Contents']); - $this->assertEmpty($files['NextContinuationToken']); + $this->assertArrayNotHasKey('NextContinuationToken', $files); } public function testName()