Code Duplication    Length = 11-11 lines in 2 locations

lib/private/Files/Storage/Flysystem.php 1 location

@@ 200-210 (lines=11) @@
197
			case 'c':
198
			case 'c+':
199
				//emulate these
200
				if ($useExisting and $this->file_exists($path)) {
201
					if (!$this->isUpdatable($path)) {
202
						return false;
203
					}
204
					$tmpFile = $this->getCachedFile($path);
205
				} else {
206
					if (!$this->isCreatable(dirname($path))) {
207
						return false;
208
					}
209
					$tmpFile = \OCP\Files::tmpFile();
210
				}
211
				$source = fopen($tmpFile, $mode);
212
				return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath) {
213
					$this->flysystem->putStream($fullPath, fopen($tmpFile, 'r'));

apps/files_external/lib/Lib/Storage/SMB.php 1 location

@@ 339-349 (lines=11) @@
336
					} else {
337
						$ext = '';
338
					}
339
					if ($this->file_exists($path)) {
340
						if (!$this->isUpdatable($path)) {
341
							return false;
342
						}
343
						$tmpFile = $this->getCachedFile($path);
344
					} else {
345
						if (!$this->isCreatable(dirname($path))) {
346
							return false;
347
						}
348
						$tmpFile = \OCP\Files::tmpFile($ext);
349
					}
350
					$source = fopen($tmpFile, $mode);
351
					$share = $this->share;
352
					return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {