diff --git a/src/Filesystem.php b/src/Filesystem.php index 0ed17a32b..0d429960a 100644 --- a/src/Filesystem.php +++ b/src/Filesystem.php @@ -119,11 +119,12 @@ private function pipeListing(string $location, bool $deep, iterable $listing): G public function move(string $source, string $destination, array $config = []): void { + $config = $this->config->extend($config); $from = $this->pathNormalizer->normalizePath($source); $to = $this->pathNormalizer->normalizePath($destination); if ($from === $to) { - $resolutionStrategy = $this->config->get( + $resolutionStrategy = $config->get( Config::OPTION_MOVE_DESTINATION_SAME_AS_SOURCE, ResolveSameSourceAndDestinationConflict::TRY, ); @@ -134,16 +135,18 @@ public function move(string $source, string $destination, array $config = []): v return; } } - $this->adapter->move($from, $to, $this->config->extend($config)); + + $this->adapter->move($from, $to, $config); } public function copy(string $source, string $destination, array $config = []): void { + $config = $this->config->extend($config); $from = $this->pathNormalizer->normalizePath($source); $to = $this->pathNormalizer->normalizePath($destination); if ($from === $to) { - $resolutionStrategy = $this->config->get( + $resolutionStrategy = $config->get( Config::OPTION_COPY_DESTINATION_SAME_AS_SOURCE, ResolveSameSourceAndDestinationConflict::TRY, ); @@ -155,7 +158,7 @@ public function copy(string $source, string $destination, array $config = []): v } } - $this->adapter->copy($from, $to, $this->config->extend($config)); + $this->adapter->copy($from, $to, $config); } public function lastModified(string $path): int