Code Duplication    Length = 4-5 lines in 2 locations

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

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

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

@@ 384-387 (lines=4) @@
381
				case 'x':
382
				case 'x+':
383
				case 'c':
384
				case 'c+':
385
					$context = stream_context_create(array('sftp' => array('session' => $this->getConnection())));
386
					$handle = fopen($this->constructUrl($path), $mode, false, $context);
387
					return RetryWrapper::wrap($handle);
388
			}
389
		} catch (\Exception $e) {
390
		}