X Tutup
Skip to content

Commit 0073430

Browse files
committed
Move variable assignment inside the condition
1 parent 4f499f3 commit 0073430

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -431,17 +431,18 @@ public function touch($path, $mtime = null) {
431431
$stat['mtime'] = $mtime;
432432
$this->getCache()->update($stat['fileid'], $stat);
433433
} else {
434-
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
435-
// create new file
436-
$stat = [
437-
'etag' => $this->getETag($path),
438-
'mimetype' => $mimeType,
439-
'size' => 0,
440-
'mtime' => $mtime,
441-
'storage_mtime' => $mtime,
442-
'permissions' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE,
443-
];
444434
if (!isset($this->movingBetweenBuckets[$this->getBucket()]['paths'][$path])) {
435+
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
436+
// create new file
437+
$stat = [
438+
'etag' => $this->getETag($path),
439+
'mimetype' => $mimeType,
440+
'size' => 0,
441+
'mtime' => $mtime,
442+
'storage_mtime' => $mtime,
443+
'permissions' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE,
444+
];
445+
445446
$fileId = $this->getCache()->put($path, $stat);
446447
try {
447448
//read an empty file from memory

0 commit comments

Comments
 (0)
X Tutup