Code Duplication    Length = 5-5 lines in 3 locations

lib/private/Files/View.php 3 locations

@@ 1162-1166 (lines=5) @@
1159
						$result = $storage->$operation($internalPath);
1160
					}
1161
				} catch (\Exception $e) {
1162
					if (in_array('write', $hooks) || in_array('delete', $hooks)) {
1163
						$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1164
					} else if (in_array('read', $hooks)) {
1165
						$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1166
					}
1167
					throw $e;
1168
				}
1169
@@ 1190-1194 (lines=5) @@
1187
					// make sure our unlocking callback will still be called if connection is aborted
1188
					ignore_user_abort(true);
1189
					$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
1190
						if (in_array('write', $hooks)) {
1191
							$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1192
						} else if (in_array('read', $hooks)) {
1193
							$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1194
						}
1195
					});
1196
				}
1197
@@ 1204-1208 (lines=5) @@
1201
					}
1202
				}
1203
1204
				if (!$unlockLater
1205
					&& (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks))
1206
				) {
1207
					$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1208
				}
1209
				return $result;
1210
			} else {
1211
				$this->unlockFile($path, ILockingProvider::LOCK_SHARED);