Skip to content

Commit

Permalink
feat: add dedicated test cases to ensure copy and move methods to alw…
Browse files Browse the repository at this point in the history
…ays overwrite target
  • Loading branch information
tinect committed Aug 9, 2024
1 parent 13f22ea commit e0e8d52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LocalFilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function copy(string $source, string $destination, Config $config): void
$this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))
);

if ( ! @copy($sourcePath, $destinationPath)) {
if ($sourcePath !== $destinationPath && ! @copy($sourcePath, $destinationPath)) {
throw UnableToCopyFile::because(error_get_last()['message'] ?? 'unknown', $source, $destination);
}

Expand Down

0 comments on commit e0e8d52

Please sign in to comment.