aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Lock
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 10:35:09 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 10:35:09 +0200
commit14c996d98256de958da367297c3313e0fa7ef9a8 (patch)
tree27074d5403b67cbaf59d7b7181481ebe70af5d9e /lib/private/Lock
parentd6e17fb01777866674129a5883c03642f4bfd4a5 (diff)
downloadnextcloud-server-14c996d98256de958da367297c3313e0fa7ef9a8.tar.gz
nextcloud-server-14c996d98256de958da367297c3313e0fa7ef9a8.zip
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Lock')
-rw-r--r--lib/private/Lock/AbstractLockingProvider.php4
-rw-r--r--lib/private/Lock/DBLockingProvider.php6
-rw-r--r--lib/private/Lock/MemcacheLockingProvider.php8
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/private/Lock/AbstractLockingProvider.php b/lib/private/Lock/AbstractLockingProvider.php
index 91870325fe2..81d949d2a06 100644
--- a/lib/private/Lock/AbstractLockingProvider.php
+++ b/lib/private/Lock/AbstractLockingProvider.php
@@ -87,7 +87,7 @@ abstract class AbstractLockingProvider implements ILockingProvider {
unset($this->acquiredLocks['shared'][$path]);
}
}
- } else if ($type === self::LOCK_EXCLUSIVE) {
+ } elseif ($type === self::LOCK_EXCLUSIVE) {
unset($this->acquiredLocks['exclusive'][$path]);
}
}
@@ -105,7 +105,7 @@ abstract class AbstractLockingProvider implements ILockingProvider {
$this->acquiredLocks['shared'][$path] = 0;
}
$this->acquiredLocks['shared'][$path]++;
- } else if ($targetType === self::LOCK_EXCLUSIVE) {
+ } elseif ($targetType === self::LOCK_EXCLUSIVE) {
$this->acquiredLocks['exclusive'][$path] = true;
$this->acquiredLocks['shared'][$path]--;
}
diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php
index a8c22b59cb1..d68535e3e9b 100644
--- a/lib/private/Lock/DBLockingProvider.php
+++ b/lib/private/Lock/DBLockingProvider.php
@@ -98,7 +98,7 @@ class DBLockingProvider extends AbstractLockingProvider {
if ($this->cacheSharedLocks) {
if ($targetType === self::LOCK_SHARED) {
$this->sharedLocks[$path] = true;
- } else if ($targetType === self::LOCK_EXCLUSIVE) {
+ } elseif ($targetType === self::LOCK_EXCLUSIVE) {
$this->sharedLocks[$path] = false;
}
}
@@ -167,7 +167,7 @@ class DBLockingProvider extends AbstractLockingProvider {
} else {
return $lockValue > 0;
}
- } else if ($type === self::LOCK_EXCLUSIVE) {
+ } elseif ($type === self::LOCK_EXCLUSIVE) {
return $lockValue === -1;
} else {
return false;
@@ -227,7 +227,7 @@ class DBLockingProvider extends AbstractLockingProvider {
'UPDATE `*PREFIX*file_locks` SET `lock` = 0 WHERE `key` = ? AND `lock` = -1',
[$path]
);
- } else if (!$this->cacheSharedLocks) {
+ } elseif (!$this->cacheSharedLocks) {
$query = $this->connection->getQueryBuilder();
$query->update('file_locks')
->set('lock', $query->func()->subtract('lock', $query->createNamedParameter(1)))
diff --git a/lib/private/Lock/MemcacheLockingProvider.php b/lib/private/Lock/MemcacheLockingProvider.php
index 6cab64b3a02..2c2d8a95938 100644
--- a/lib/private/Lock/MemcacheLockingProvider.php
+++ b/lib/private/Lock/MemcacheLockingProvider.php
@@ -60,7 +60,7 @@ class MemcacheLockingProvider extends AbstractLockingProvider {
$lockValue = $this->memcache->get($path);
if ($type === self::LOCK_SHARED) {
return $lockValue > 0;
- } else if ($type === self::LOCK_EXCLUSIVE) {
+ } elseif ($type === self::LOCK_EXCLUSIVE) {
return $lockValue === 'exclusive';
} else {
return false;
@@ -108,7 +108,7 @@ class MemcacheLockingProvider extends AbstractLockingProvider {
if ($newValue < 0) {
$this->memcache->cad($path, $newValue);
}
- } else if ($type === self::LOCK_EXCLUSIVE) {
+ } elseif ($type === self::LOCK_EXCLUSIVE) {
$this->memcache->cad($path, 'exclusive');
}
$this->markRelease($path, $type);
@@ -126,7 +126,7 @@ class MemcacheLockingProvider extends AbstractLockingProvider {
if (!$this->memcache->cas($path, 'exclusive', 1)) {
throw new LockedException($path, null, $this->getExistingLockForException($path));
}
- } else if ($targetType === self::LOCK_EXCLUSIVE) {
+ } elseif ($targetType === self::LOCK_EXCLUSIVE) {
// we can only change a shared lock to an exclusive if there's only a single owner of the shared lock
if (!$this->memcache->cas($path, 1, 'exclusive')) {
throw new LockedException($path, null, $this->getExistingLockForException($path));
@@ -140,7 +140,7 @@ class MemcacheLockingProvider extends AbstractLockingProvider {
$existing = $this->memcache->get($path);
if (!$existing) {
return 'none';
- } else if ($existing === 'exclusive') {
+ } elseif ($existing === 'exclusive') {
return $existing;
} else {
return $existing . ' shared locks';