From e7381ef7643f658b87efb7dbe98fe538fb1bbf32 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Thu, 19 Oct 2023 22:07:13 +0200 Subject: [PATCH] Added ability to set resolution strategy for copy and move conflicts. --- LocalFilesystemAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LocalFilesystemAdapter.php b/LocalFilesystemAdapter.php index aeb1eab..c91a9bf 100644 --- a/LocalFilesystemAdapter.php +++ b/LocalFilesystemAdapter.php @@ -248,7 +248,7 @@ public function move(string $source, string $destination, Config $config): void ); if ( ! @rename($sourcePath, $destinationPath)) { - throw UnableToMoveFile::fromLocationTo($sourcePath, $destinationPath); + throw UnableToMoveFile::because(error_get_last()['message'] ?? 'unknown reason', $source, $destination); } } @@ -263,7 +263,7 @@ public function copy(string $source, string $destination, Config $config): void ); if ( ! @copy($sourcePath, $destinationPath)) { - throw UnableToCopyFile::fromLocationTo($sourcePath, $destinationPath); + throw UnableToCopyFile::because(error_get_last()['message'] ?? 'unknown', $source, $destination); } }