Code Duplication    Length = 3-3 lines in 3 locations

lib/private/lock/abstractlockingprovider.php 2 locations

@@ 61-63 (lines=3) @@
58
	 */
59
	protected function markAcquire($path, $type) {
60
		if ($type === self::LOCK_SHARED) {
61
			if (!isset($this->acquiredLocks['shared'][$path])) {
62
				$this->acquiredLocks['shared'][$path] = 0;
63
			}
64
			$this->acquiredLocks['shared'][$path]++;
65
		} else {
66
			$this->acquiredLocks['exclusive'][$path] = true;
@@ 98-100 (lines=3) @@
95
	protected function markChange($path, $targetType) {
96
		if ($targetType === self::LOCK_SHARED) {
97
			unset($this->acquiredLocks['exclusive'][$path]);
98
			if (!isset($this->acquiredLocks['shared'][$path])) {
99
				$this->acquiredLocks['shared'][$path] = 0;
100
			}
101
			$this->acquiredLocks['shared'][$path]++;
102
		} else if ($targetType === self::LOCK_EXCLUSIVE) {
103
			$this->acquiredLocks['exclusive'][$path] = true;

lib/private/lock/dblockingprovider.php 1 location

@@ 220-222 (lines=3) @@
217
			);
218
		} else {
219
			// since we only keep one shared lock in the db we need to check if we have more then one shared lock locally manually
220
			if (isset($this->acquiredLocks['shared'][$path]) && $this->acquiredLocks['shared'][$path] > 1) {
221
				throw new LockedException($path);
222
			}
223
			$result = $this->connection->executeUpdate(
224
				'UPDATE `*PREFIX*file_locks` SET `lock` = -1, `ttl` = ? WHERE `key` = ? AND `lock` = 1',
225
				[$expire, $path]