Code Duplication    Length = 11-11 lines in 2 locations

apps/files_external/lib/smb.php 1 location

@@ 217-227 (lines=11) @@
214
					} else {
215
						$ext = '';
216
					}
217
					if ($this->file_exists($path)) {
218
						if (!$this->isUpdatable($path)) {
219
							return false;
220
						}
221
						$tmpFile = $this->getCachedFile($path);
222
					} else {
223
						if (!$this->isCreatable(dirname($path))) {
224
							return false;
225
						}
226
						$tmpFile = \OCP\Files::tmpFile($ext);
227
					}
228
					$source = fopen($tmpFile, $mode);
229
					$share = $this->share;
230
					return CallBackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {

lib/private/files/storage/dav.php 1 location

@@ 391-401 (lines=11) @@
388
				} else {
389
					$ext = '';
390
				}
391
				if ($this->file_exists($path)) {
392
					if (!$this->isUpdatable($path)) {
393
						return false;
394
					}
395
					$tmpFile = $this->getCachedFile($path);
396
				} else {
397
					if (!$this->isCreatable(dirname($path))) {
398
						return false;
399
					}
400
					$tmpFile = Files::tmpFile($ext);
401
				}
402
				Close::registerCallback($tmpFile, array($this, 'writeBack'));
403
				self::$tempFiles[$tmpFile] = $path;
404
				return fopen('close://' . $tmpFile, $mode);