From 15a69811b19eb36a09884272912d95c81e101582 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Sat, 4 Nov 2023 14:34:10 +0100 Subject: [PATCH] Ignore visibility by default on copy/move in Filesystem --- src/Filesystem.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Filesystem.php b/src/Filesystem.php index 0a8ef09ba..b28ec63cb 100644 --- a/src/Filesystem.php +++ b/src/Filesystem.php @@ -119,7 +119,9 @@ 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); + $config = $this->config + ->extend([Config::OPTION_VISIBILITY => null]) + ->extend($config); $from = $this->pathNormalizer->normalizePath($source); $to = $this->pathNormalizer->normalizePath($destination); @@ -138,7 +140,9 @@ public function move(string $source, string $destination, array $config = []): v public function copy(string $source, string $destination, array $config = []): void { - $config = $this->config->extend($config); + $config = $this->config + ->extend([Config::OPTION_VISIBILITY => null]) + ->extend($config); $from = $this->pathNormalizer->normalizePath($source); $to = $this->pathNormalizer->normalizePath($destination);