Code Duplication    Length = 5-5 lines in 3 locations

lib/private/Files/View.php 3 locations

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