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

@@ 414-420 (lines=7) @@
411
					return false;
412
				}
413
			case 'w':
414
			case 'wb':
415
				$tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
416
417
				$handle = fopen($tmpFile, 'w');
418
				return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
419
					$this->writeBack($tmpFile, $path);
420
				});
421
			case 'a':
422
			case 'ab':
423
			case 'r+':