diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 10:35:09 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 10:35:09 +0200 |
commit | 14c996d98256de958da367297c3313e0fa7ef9a8 (patch) | |
tree | 27074d5403b67cbaf59d7b7181481ebe70af5d9e /lib/private/Files/Storage | |
parent | d6e17fb01777866674129a5883c03642f4bfd4a5 (diff) | |
download | nextcloud-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/Files/Storage')
-rw-r--r-- | lib/private/Files/Storage/Common.php | 4 | ||||
-rw-r--r-- | lib/private/Files/Storage/DAV.php | 22 | ||||
-rw-r--r-- | lib/private/Files/Storage/Local.php | 8 | ||||
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encryption.php | 4 |
4 files changed, 19 insertions, 19 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index f2d427227c9..456980db538 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -104,7 +104,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage { protected function remove($path) { if ($this->is_dir($path)) { return $this->rmdir($path); - } else if ($this->is_file($path)) { + } elseif ($this->is_file($path)) { return $this->unlink($path); } else { return false; @@ -439,7 +439,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage { foreach (explode('/', $path) as $chunk) { if ($chunk == '..') { array_pop($output); - } else if ($chunk == '.') { + } elseif ($chunk == '.') { } else { $output[] = $chunk; } diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index 3654ef1285c..3100a14a570 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -99,7 +99,7 @@ class DAV extends Common { $host = $params['host']; //remove leading http[s], will be generated in createBaseUri() if (substr($host, 0, 8) == "https://") $host = substr($host, 8); - else if (substr($host, 0, 7) == "http://") $host = substr($host, 7); + elseif (substr($host, 0, 7) == "http://") $host = substr($host, 7); $this->host = $host; $this->user = $params['user']; $this->password = $params['password']; @@ -320,7 +320,7 @@ class DAV extends Common { if ($cachedState === false) { // we know the file doesn't exist return false; - } else if (!is_null($cachedState)) { + } elseif (!is_null($cachedState)) { return true; } // need to get from server @@ -718,9 +718,9 @@ class DAV extends Common { } if (isset($response['{http://owncloud.org/ns}permissions'])) { return $this->parsePermissions($response['{http://owncloud.org/ns}permissions']); - } else if ($this->is_dir($path)) { + } elseif ($this->is_dir($path)) { return Constants::PERMISSION_ALL; - } else if ($this->file_exists($path)) { + } elseif ($this->file_exists($path)) { return Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE; } else { return 0; @@ -797,10 +797,10 @@ class DAV extends Common { } if (!empty($etag) && $cachedData['etag'] !== $etag) { return true; - } else if (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) { + } elseif (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) { $sharePermissions = (int)$response['{http://open-collaboration-services.org/ns}share-permissions']; return $sharePermissions !== $cachedData['permissions']; - } else if (isset($response['{http://owncloud.org/ns}permissions'])) { + } elseif (isset($response['{http://owncloud.org/ns}permissions'])) { $permissions = $this->parsePermissions($response['{http://owncloud.org/ns}permissions']); return $permissions !== $cachedData['permissions']; } else { @@ -850,22 +850,22 @@ class DAV extends Common { if ($e->getHttpStatus() === Http::STATUS_UNAUTHORIZED) { // either password was changed or was invalid all along throw new StorageInvalidException(get_class($e) . ': ' . $e->getMessage()); - } else if ($e->getHttpStatus() === Http::STATUS_METHOD_NOT_ALLOWED) { + } elseif ($e->getHttpStatus() === Http::STATUS_METHOD_NOT_ALLOWED) { // ignore exception for MethodNotAllowed, false will be returned return; - } else if ($e->getHttpStatus() === Http::STATUS_FORBIDDEN){ + } elseif ($e->getHttpStatus() === Http::STATUS_FORBIDDEN){ // The operation is forbidden. Fail somewhat gracefully throw new ForbiddenException(get_class($e) . ':' . $e->getMessage()); } throw new StorageNotAvailableException(get_class($e) . ': ' . $e->getMessage()); - } else if ($e instanceof ClientException) { + } elseif ($e instanceof ClientException) { // connection timeout or refused, server could be temporarily down throw new StorageNotAvailableException(get_class($e) . ': ' . $e->getMessage()); - } else if ($e instanceof \InvalidArgumentException) { + } elseif ($e instanceof \InvalidArgumentException) { // parse error because the server returned HTML instead of XML, // possibly temporarily down throw new StorageNotAvailableException(get_class($e) . ': ' . $e->getMessage()); - } else if (($e instanceof StorageNotAvailableException) || ($e instanceof StorageInvalidException)) { + } elseif (($e instanceof StorageNotAvailableException) || ($e instanceof StorageInvalidException)) { // rethrow throw $e; } diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index fbb84418e2e..05dd8c4d68f 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -112,9 +112,9 @@ class Local extends \OC\Files\Storage\Common { if (in_array($file->getBasename(), ['.', '..'])) { $it->next(); continue; - } else if ($file->isDir()) { + } elseif ($file->isDir()) { rmdir($file->getPathname()); - } else if ($file->isFile() || $file->isLink()) { + } elseif ($file->isFile() || $file->isLink()) { unlink($file->getPathname()); } $it->next(); @@ -275,7 +275,7 @@ class Local extends \OC\Files\Storage\Common { public function unlink($path) { if ($this->is_dir($path)) { return $this->rmdir($path); - } else if ($this->is_file($path)) { + } elseif ($this->is_file($path)) { return unlink($this->getSourcePath($path)); } else { return false; @@ -316,7 +316,7 @@ class Local extends \OC\Files\Storage\Common { if ($this->is_dir($path2)) { $this->rmdir($path2); - } else if ($this->is_file($path2)) { + } elseif ($this->is_file($path2)) { $this->unlink($path2); } diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index eb92f07d973..850b6205412 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -437,7 +437,7 @@ class Encryption extends Wrapper { if (!empty($encryptionModuleId)) { $encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId); $shouldEncrypt = true; - } else if (empty($encryptionModuleId) && $info['encrypted'] === true) { + } elseif (empty($encryptionModuleId) && $info['encrypted'] === true) { // we come from a old installation. No header and/or no module defined // but the file is encrypted. In this case we need to use the // OC_DEFAULT_MODULE to read the file @@ -935,7 +935,7 @@ class Encryption extends Wrapper { if (!isset($result[Util::HEADER_ENCRYPTION_MODULE_KEY])) { if (!empty($result)) { $result[Util::HEADER_ENCRYPTION_MODULE_KEY] = 'OC_DEFAULT_MODULE'; - } else if ($exists) { + } elseif ($exists) { // if the header was empty we have to check first if it is a encrypted file at all // We would do query to filecache only if we know that entry in filecache exists $info = $this->getCache()->get($path); |