Code Duplication    Length = 6-6 lines in 2 locations

apps/dav/lib/Connector/Sabre/File.php 2 locations

@@ 489-494 (lines=6) @@
486
			$absPath = $this->fileView->getAbsolutePath($targetPath);
487
			$beforeEvent = new GenericEvent(null, ['path' => $absPath]);
488
			$newFile = false;
489
			if (!$this->fileView->file_exists($targetPath)) {
490
				\OC::$server->getEventDispatcher()->dispatch('file.beforecreate', $beforeEvent);
491
				$newFile = true;
492
			} else {
493
				\OC::$server->getEventDispatcher()->dispatch('file.beforeupdate', $beforeEvent);
494
			}
495
496
			/** @var \OC\Files\Storage\Storage $targetStorage */
497
			list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath);
@@ 161-166 (lines=6) @@
158
		$newFile = false;
159
		$path = $this->fileView->getAbsolutePath($this->path);
160
		$beforeEvent = new GenericEvent(null, ['path' => $path]);
161
		if (!$this->fileView->file_exists($this->path)) {
162
			\OC::$server->getEventDispatcher()->dispatch('file.beforecreate', $beforeEvent);
163
			$newFile = true;
164
		} else {
165
			\OC::$server->getEventDispatcher()->dispatch('file.beforeupdate', $beforeEvent);
166
		}
167
168
		list($partStorage) = $this->fileView->resolvePath($this->path);
169
		$needsPartFile = $this->needsPartFile($partStorage) && (\strlen($this->path) > 1);