Code Duplication    Length = 5-5 lines in 3 locations

lib/private/Files/View.php 3 locations

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