Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 11:35:09 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 11:35:09 +0300
commit14c996d98256de958da367297c3313e0fa7ef9a8 (patch)
tree27074d5403b67cbaf59d7b7181481ebe70af5d9e /lib/private/Files/Cache
parentd6e17fb01777866674129a5883c03642f4bfd4a5 (diff)
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r--lib/private/Files/Cache/Cache.php8
-rw-r--r--lib/private/Files/Cache/QuerySearchHelper.php14
-rw-r--r--lib/private/Files/Cache/Scanner.php8
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php2
4 files changed, 16 insertions, 16 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index a6daec2a8f3..bce9a1d88e0 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -155,7 +155,7 @@ class Cache implements ICache {
//merge partial data
if (!$data and is_string($file) and isset($this->partial[$file])) {
return $this->partial[$file];
- } else if (!$data) {
+ } elseif (!$data) {
return $data;
} else {
return self::cacheEntryFromData($data, $this->mimetypeLoader);
@@ -425,14 +425,14 @@ class Cache implements ICache {
if (array_search($name, $fields) !== false) {
if ($name === 'path') {
$params['path_hash'] = md5($value);
- } else if ($name === 'mimetype') {
+ } elseif ($name === 'mimetype') {
$params['mimepart'] = $this->mimetypeLoader->getId(substr($value, 0, strpos($value, '/')));
$value = $this->mimetypeLoader->getId($value);
- } else if ($name === 'storage_mtime') {
+ } elseif ($name === 'storage_mtime') {
if (!$doNotCopyStorageMTime && !isset($data['mtime'])) {
$params['mtime'] = $value;
}
- } else if ($name === 'encrypted') {
+ } elseif ($name === 'encrypted') {
if (isset($data['encryptedVersion'])) {
$value = $data['encryptedVersion'];
} else {
diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php
index 7a0b9f3a24a..9f2d7aadd7e 100644
--- a/lib/private/Files/Cache/QuerySearchHelper.php
+++ b/lib/private/Files/Cache/QuerySearchHelper.php
@@ -79,7 +79,7 @@ class QuerySearchHelper {
return array_reduce($operator->getArguments(), function ($shouldJoin, ISearchOperator $operator) {
return $shouldJoin || $this->shouldJoinTags($operator);
}, false);
- } else if ($operator instanceof ISearchComparison) {
+ } elseif ($operator instanceof ISearchComparison) {
return $operator->getField() === 'tagname' || $operator->getField() === 'favorite';
}
return false;
@@ -117,7 +117,7 @@ class QuerySearchHelper {
default:
throw new \InvalidArgumentException('Invalid operator type: ' . $operator->getType());
}
- } else if ($operator instanceof ISearchComparison) {
+ } elseif ($operator instanceof ISearchComparison) {
return $this->searchComparisonToDBExpr($builder, $operator, self::$searchOperatorMap);
} else {
throw new \InvalidArgumentException('Invalid operator type: ' . get_class($operator));
@@ -143,13 +143,13 @@ class QuerySearchHelper {
if ($field === 'mimetype') {
if ($operator->getType() === ISearchComparison::COMPARE_EQUAL) {
$value = (int)$this->mimetypeLoader->getId($value);
- } else if ($operator->getType() === ISearchComparison::COMPARE_LIKE) {
+ } elseif ($operator->getType() === ISearchComparison::COMPARE_LIKE) {
// transform "mimetype='foo/%'" to "mimepart='foo'"
if (preg_match('|(.+)/%|', $value, $matches)) {
$field = 'mimepart';
$value = (int)$this->mimetypeLoader->getId($matches[1]);
$type = ISearchComparison::COMPARE_EQUAL;
- } else if (strpos($value, '%') !== false) {
+ } elseif (strpos($value, '%') !== false) {
throw new \InvalidArgumentException('Unsupported query value for mimetype: ' . $value . ', only values in the format "mime/type" or "mime/%" are supported');
} else {
$field = 'mimetype';
@@ -157,12 +157,12 @@ class QuerySearchHelper {
$type = ISearchComparison::COMPARE_EQUAL;
}
}
- } else if ($field === 'favorite') {
+ } elseif ($field === 'favorite') {
$field = 'tag.category';
$value = self::TAG_FAVORITE;
- } else if ($field === 'tagname') {
+ } elseif ($field === 'tagname') {
$field = 'tag.category';
- } else if ($field === 'fileid') {
+ } elseif ($field === 'fileid') {
$field = 'file.fileid';
}
return [$field, $value, $type];
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index f2c998eeeed..87f32538ec7 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -412,7 +412,7 @@ class Scanner extends BasicEmitter implements IScanner {
$childSize = $this->scanChildren($child, $recursive, $reuse, $childId, $lock);
if ($childSize === -1) {
$size = -1;
- } else if ($size !== -1) {
+ } elseif ($size !== -1) {
$size += $childSize;
}
}
@@ -442,12 +442,12 @@ class Scanner extends BasicEmitter implements IScanner {
if ($data) {
if ($data['mimetype'] === 'httpd/unix-directory' and $recursive === self::SCAN_RECURSIVE) {
$childQueue[$child] = $data['fileid'];
- } else if ($data['mimetype'] === 'httpd/unix-directory' and $recursive === self::SCAN_RECURSIVE_INCOMPLETE and $data['size'] === -1) {
+ } elseif ($data['mimetype'] === 'httpd/unix-directory' and $recursive === self::SCAN_RECURSIVE_INCOMPLETE and $data['size'] === -1) {
// only recurse into folders which aren't fully scanned
$childQueue[$child] = $data['fileid'];
- } else if ($data['size'] === -1) {
+ } elseif ($data['size'] === -1) {
$size = -1;
- } else if ($size !== -1) {
+ } elseif ($size !== -1) {
$size += $data['size'];
}
}
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index a77270329ad..8c30eeda2cf 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -75,7 +75,7 @@ class CacheJail extends CacheWrapper {
$rootLength = strlen($this->getRoot()) + 1;
if ($path === $this->getRoot()) {
return '';
- } else if (substr($path, 0, $rootLength) === $this->getRoot() . '/') {
+ } elseif (substr($path, 0, $rootLength) === $this->getRoot() . '/') {
return substr($path, $rootLength);
} else {
return null;