Code Duplication    Length = 11-11 lines in 2 locations

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

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

apps/files_external/lib/storage/smb.php 1 location

@@ 250-260 (lines=11) @@
247
					} else {
248
						$ext = '';
249
					}
250
					if ($this->file_exists($path)) {
251
						if (!$this->isUpdatable($path)) {
252
							return false;
253
						}
254
						$tmpFile = $this->getCachedFile($path);
255
					} else {
256
						if (!$this->isCreatable(dirname($path))) {
257
							return false;
258
						}
259
						$tmpFile = \OCP\Files::tmpFile($ext);
260
					}
261
					$source = fopen($tmpFile, $mode);
262
					$share = $this->share;
263
					return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {