From c6ff6d4606e48249b63f269eba7fabdb584e76a9 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sat, 17 Aug 2024 15:10:48 +0200 Subject: [PATCH] Make same path copy/move a no-op for AWS S3 --- AwsS3V3Adapter.php | 8 ++++++++ AwsS3V3AdapterTest.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AwsS3V3Adapter.php b/AwsS3V3Adapter.php index 40174e1..c020335 100644 --- a/AwsS3V3Adapter.php +++ b/AwsS3V3Adapter.php @@ -407,6 +407,10 @@ private function retrievePaginatedListing(array $options): Generator public function move(string $source, string $destination, Config $config): void { + if ($source === $destination) { + return; + } + try { $this->copy($source, $destination, $config); $this->delete($source); @@ -417,6 +421,10 @@ public function move(string $source, string $destination, Config $config): void public function copy(string $source, string $destination, Config $config): void { + if ($source === $destination) { + return; + } + try { $visibility = $config->get(Config::OPTION_VISIBILITY); diff --git a/AwsS3V3AdapterTest.php b/AwsS3V3AdapterTest.php index 04daa66..d2fbb5c 100644 --- a/AwsS3V3AdapterTest.php +++ b/AwsS3V3AdapterTest.php @@ -81,7 +81,7 @@ protected function tearDown(): void protected function setUp(): void { - if (PHP_VERSION_ID < 801000) { + if (PHP_VERSION_ID < 80100) { $this->markTestSkipped('AWS does not support this anymore.'); }