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/DAV.php | |
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/DAV.php')
-rw-r--r-- | lib/private/Files/Storage/DAV.php | 22 |
1 files changed, 11 insertions, 11 deletions
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; } |