Code Duplication    Length = 5-5 lines in 3 locations

lib/private/Files/View.php 3 locations

@@ 1118-1122 (lines=5) @@
1115
						$result = $storage->$operation($internalPath);
1116
					}
1117
				} catch (\Exception $e) {
1118
					if (in_array('write', $hooks) || in_array('delete', $hooks)) {
1119
						$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1120
					} else if (in_array('read', $hooks)) {
1121
						$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1122
					}
1123
					throw $e;
1124
				}
1125
@@ 1146-1150 (lines=5) @@
1143
					// make sure our unlocking callback will still be called if connection is aborted
1144
					ignore_user_abort(true);
1145
					$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
1146
						if (in_array('write', $hooks)) {
1147
							$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1148
						} else if (in_array('read', $hooks)) {
1149
							$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1150
						}
1151
					});
1152
				}
1153
@@ 1160-1164 (lines=5) @@
1157
					}
1158
				}
1159
1160
				if (!$unlockLater
1161
					&& (in_array('write', $hooks) || in_array('delete', $hooks) || in_array('read', $hooks))
1162
				) {
1163
					$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
1164
				}
1165
				return $result;
1166
			} else {
1167
				$this->unlockFile($path, ILockingProvider::LOCK_SHARED);