Code Duplication    Length = 5-5 lines in 3 locations

lib/private/Files/View.php 3 locations

@@ 1125-1129 (lines=5) @@
1122
						$result = $storage->$operation($internalPath);
1123
					}
1124
				} catch (\Exception $e) {
1125
					if (in_array('write', $hooks) || in_array('delete', $hooks)) {
1126
						$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1127
					} else if (in_array('read', $hooks)) {
1128
						$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1129
					}
1130
					throw $e;
1131
				}
1132
@@ 1153-1157 (lines=5) @@
1150
					// make sure our unlocking callback will still be called if connection is aborted
1151
					ignore_user_abort(true);
1152
					$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
1153
						if (in_array('write', $hooks)) {
1154
							$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1155
						} else if (in_array('read', $hooks)) {
1156
							$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1157
						}
1158
					});
1159
				}
1160
@@ 1167-1171 (lines=5) @@
1164
					}
1165
				}
1166
1167
				if (!$unlockLater
1168
					&& (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks))
1169
				) {
1170
					$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1171
				}
1172
				return $result;
1173
			} else {
1174
				$this->unlockFile($path, ILockingProvider::LOCK_SHARED);