Code Duplication    Length = 4-5 lines in 2 locations

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

@@ 107-111 (lines=5) @@
104
			case 'w':
105
			case 'wb':
106
			case 'a':
107
			case 'ab':
108
				//these are supported by the wrapper
109
				$context = stream_context_create(array('ftp' => array('overwrite' => true)));
110
				$handle = fopen($this->constructUrl($path), $mode, false, $context);
111
				return RetryWrapper::wrap($handle);
112
			case 'r+':
113
			case 'w+':
114
			case 'wb+':

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

@@ 376-379 (lines=4) @@
373
				case 'x':
374
				case 'x+':
375
				case 'c':
376
				case 'c+':
377
					$context = stream_context_create(array('sftp' => array('session' => $this->getConnection())));
378
					$handle = fopen($this->constructUrl($path), $mode, false, $context);
379
					return RetryWrapper::wrap($handle);
380
			}
381
		} catch (\Exception $e) {
382
		}