summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Storage/SMB.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/SMB.php')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 7e297885ded..1d4cf5a7a2e 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -306,22 +306,22 @@ class SMB extends Common implements INotifyStorage {
/**
* Rename the files. If the source or the target is the root, the rename won't happen.
*
- * @param string $path1 the old name of the path
- * @param string $path2 the new name of the path
+ * @param string $source the old name of the path
+ * @param string $target the new name of the path
* @return bool true if the rename is successful, false otherwise
*/
- public function rename($path1, $path2, $retry = true) {
- if ($this->isRootDir($path1) || $this->isRootDir($path2)) {
+ public function rename($source, $target, $retry = true): bool {
+ if ($this->isRootDir($source) || $this->isRootDir($target)) {
return false;
}
- $absoluteSource = $this->buildPath($path1);
- $absoluteTarget = $this->buildPath($path2);
+ $absoluteSource = $this->buildPath($source);
+ $absoluteTarget = $this->buildPath($target);
try {
$result = $this->share->rename($absoluteSource, $absoluteTarget);
} catch (AlreadyExistsException $e) {
if ($retry) {
- $this->remove($path2);
+ $this->remove($target);
$result = $this->share->rename($absoluteSource, $absoluteTarget);
} else {
$this->logger->logException($e, ['level' => ILogger::WARN]);
@@ -329,7 +329,7 @@ class SMB extends Common implements INotifyStorage {
}
} catch (InvalidArgumentException $e) {
if ($retry) {
- $this->remove($path2);
+ $this->remove($target);
$result = $this->share->rename($absoluteSource, $absoluteTarget);
} else {
$this->logger->logException($e, ['level' => ILogger::WARN]);