Code Duplication    Length = 6-7 lines in 2 locations

lib/private/Files/ObjectStore/ObjectStoreStorage.php 1 location

@@ 290-295 (lines=6) @@
287
			case 'w':
288
			case 'wb':
289
			case 'w+':
290
			case 'wb+':
291
				$tmpFile = \OC::$server->getTempManager()->getTemporaryFile($ext);
292
				$handle = fopen($tmpFile, $mode);
293
				return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
294
					$this->writeBack($tmpFile, $path);
295
				});
296
			case 'a':
297
			case 'ab':
298
			case 'r+':

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

@@ 464-470 (lines=7) @@
461
					return false;
462
				}
463
			case 'w':
464
			case 'wb':
465
				$tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
466
467
				$handle = fopen($tmpFile, 'w');
468
				return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
469
					$this->writeBack($tmpFile, $path);
470
				});
471
			case 'a':
472
			case 'ab':
473
			case 'r+':