aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Storage
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2024-08-23 15:10:27 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2024-08-25 19:34:58 +0200
commitaf6de04e9e141466dc229e444ff3f146f4a34765 (patch)
tree7b93f521865cdecdadb33637dea33bea242e7969 /apps/files_external/lib/Lib/Storage
parent1cc6b3577fdbeadece7e4e6478e7f7755555b41a (diff)
downloadnextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.tar.gz
nextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.zip
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_external/lib/Lib/Storage')
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/FtpConnection.php14
-rw-r--r--apps/files_external/lib/Lib/Storage/OwnCloud.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php12
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/Swift.php4
7 files changed, 26 insertions, 26 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 895bd00c462..43646ac681a 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -128,9 +128,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
}
- if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]["Key"])) {
+ if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]['Key'])) {
/** @psalm-suppress InvalidArgument Psalm doesn't understand nested arrays well */
- $this->objectCache[$key]["Key"] = $key;
+ $this->objectCache[$key]['Key'] = $key;
}
return $this->objectCache[$key];
}
@@ -766,7 +766,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
if (!is_resource($stream)) {
- throw new \InvalidArgumentException("Invalid stream provided");
+ throw new \InvalidArgumentException('Invalid stream provided');
}
$path = $this->normalizePath($path);
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php
index 0af6ca141bb..d1f67c5a741 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -66,11 +66,11 @@ class FTP extends Common {
$this->password
);
} catch (\Exception $e) {
- throw new StorageNotAvailableException("Failed to create ftp connection", 0, $e);
+ throw new StorageNotAvailableException('Failed to create ftp connection', 0, $e);
}
if ($this->utf8Mode) {
if (!$this->connection->setUtf8Mode()) {
- throw new StorageNotAvailableException("Could not set UTF-8 mode");
+ throw new StorageNotAvailableException('Could not set UTF-8 mode');
}
}
}
@@ -219,7 +219,7 @@ class FTP extends Common {
}
public function is_dir($path) {
- if ($path === "") {
+ if ($path === '') {
return true;
}
if ($this->getConnection()->chdir($this->buildPath($path)) === true) {
diff --git a/apps/files_external/lib/Lib/Storage/FtpConnection.php b/apps/files_external/lib/Lib/Storage/FtpConnection.php
index 8855dffbc0f..a064bf9b100 100644
--- a/apps/files_external/lib/Lib/Storage/FtpConnection.php
+++ b/apps/files_external/lib/Lib/Storage/FtpConnection.php
@@ -23,11 +23,11 @@ class FtpConnection {
}
if ($connection === false) {
- throw new \Exception("Failed to connect to ftp");
+ throw new \Exception('Failed to connect to ftp');
}
if (ftp_login($connection, $username, $password) === false) {
- throw new \Exception("Failed to connect to login to ftp");
+ throw new \Exception('Failed to connect to login to ftp');
}
ftp_pasv($connection, true);
@@ -39,7 +39,7 @@ class FtpConnection {
}
public function setUtf8Mode(): bool {
- $response = ftp_raw($this->connection, "OPTS UTF8 ON");
+ $response = ftp_raw($this->connection, 'OPTS UTF8 ON');
return substr($response[0], 0, 3) === '200';
}
@@ -75,8 +75,8 @@ class FtpConnection {
$result = @ftp_mdtm($this->connection, $path);
// filezilla doesn't like empty path with mdtm
- if ($result === -1 && $path === "") {
- $result = @ftp_mdtm($this->connection, "/");
+ if ($result === -1 && $path === '') {
+ $result = @ftp_mdtm($this->connection, '/');
}
return $result;
}
@@ -150,13 +150,13 @@ class FtpConnection {
$parsedDate = (new \DateTime())
->setTimestamp(strtotime("$month $day $time"));
- $tomorrow = (new \DateTime())->add(new \DateInterval("P1D"));
+ $tomorrow = (new \DateTime())->add(new \DateInterval('P1D'));
// since the provided date doesn't include the year, we either set it to the correct year
// or when the date would otherwise be in the future (by more then 1 day to account for timezone errors)
// we use last year
if ($parsedDate > $tomorrow) {
- $parsedDate = $parsedDate->sub(new \DateInterval("P1Y"));
+ $parsedDate = $parsedDate->sub(new \DateInterval('P1Y'));
}
$formattedDate = $parsedDate
diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php
index d5562a3cb32..fb5c7207486 100644
--- a/apps/files_external/lib/Lib/Storage/OwnCloud.php
+++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php
@@ -24,10 +24,10 @@ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorag
// (owncloud install path on host)
$host = $params['host'];
// strip protocol
- if (substr($host, 0, 8) === "https://") {
+ if (substr($host, 0, 8) === 'https://') {
$host = substr($host, 8);
$params['secure'] = true;
- } elseif (substr($host, 0, 7) === "http://") {
+ } elseif (substr($host, 0, 7) === 'http://') {
$host = substr($host, 7);
$params['secure'] = false;
}
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 6046b7266f5..1fb6dec671d 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -239,7 +239,7 @@ class SFTP extends Common {
$lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines) {
foreach ($lines as $line) {
- $hostKeyArray = explode("::", $line, 2);
+ $hostKeyArray = explode('::', $line, 2);
if (count($hostKeyArray) === 2) {
$hosts[] = $hostKeyArray[0];
$keys[] = $hostKeyArray[1];
@@ -311,11 +311,11 @@ class SFTP extends Common {
if (!is_array($stat) || !array_key_exists('type', $stat)) {
return false;
}
- if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) {
+ if ((int)$stat['type'] === NET_SFTP_TYPE_REGULAR) {
return 'file';
}
- if ((int) $stat['type'] === NET_SFTP_TYPE_DIRECTORY) {
+ if ((int)$stat['type'] === NET_SFTP_TYPE_DIRECTORY) {
return 'dir';
}
} catch (\Exception $e) {
@@ -478,7 +478,7 @@ class SFTP extends Common {
$size = $writtenSize;
});
if (!$stream) {
- throw new \Exception("Failed to wrap stream");
+ throw new \Exception('Failed to wrap stream');
}
}
/** @psalm-suppress InternalMethod */
@@ -486,11 +486,11 @@ class SFTP extends Common {
fclose($stream);
if ($result) {
if ($size === null) {
- throw new \Exception("Failed to get written size from sftp storage wrapper");
+ throw new \Exception('Failed to get written size from sftp storage wrapper');
}
return $size;
} else {
- throw new \Exception("Failed to write steam to sftp storage");
+ throw new \Exception('Failed to write steam to sftp storage');
}
}
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 066d0d08f5b..bd871626bd9 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -111,7 +111,7 @@ class SMB extends Common implements INotifyStorage {
$this->root = rtrim($this->root, '/') . '/';
$this->showHidden = isset($params['show_hidden']) && $params['show_hidden'];
- $this->caseSensitive = (bool) ($params['case_sensitive'] ?? true);
+ $this->caseSensitive = (bool)($params['case_sensitive'] ?? true);
$this->checkAcl = isset($params['check_acl']) && $params['check_acl'];
$this->statCache = new CappedMemoryCache();
@@ -502,7 +502,7 @@ class SMB extends Common implements INotifyStorage {
} catch (ForbiddenException $e) {
return false;
} catch (OutOfSpaceException $e) {
- throw new EntityTooLargeException("not enough available space to create file", 0, $e);
+ throw new EntityTooLargeException('not enough available space to create file', 0, $e);
} catch (ConnectException $e) {
$this->logger->error('Error while opening file', ['exception' => $e]);
throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e);
@@ -545,7 +545,7 @@ class SMB extends Common implements INotifyStorage {
}
return false;
} catch (OutOfSpaceException $e) {
- throw new EntityTooLargeException("not enough available space to create file", 0, $e);
+ throw new EntityTooLargeException('not enough available space to create file', 0, $e);
} catch (ConnectException $e) {
$this->logger->error('Error while creating file', ['exception' => $e]);
throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e);
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php
index f25c3cb304b..64b3179efef 100644
--- a/apps/files_external/lib/Lib/Storage/Swift.php
+++ b/apps/files_external/lib/Lib/Storage/Swift.php
@@ -88,7 +88,7 @@ class Swift extends \OC\Files\Storage\Common {
*
* @param string $path
* @return StorageObject|bool object
- * or false if the object did not exist
+ * or false if the object did not exist
* @throws \OCP\Files\StorageAuthException
* @throws \OCP\Files\StorageNotAvailableException
*/
@@ -134,7 +134,7 @@ class Swift extends \OC\Files\Storage\Common {
or (empty($params['user']) && empty($params['userid'])) or empty($params['bucket'])
or empty($params['region'])
) {
- throw new StorageBadConfigException("API Key or password, Login, Bucket and Region have to be configured.");
+ throw new StorageBadConfigException('API Key or password, Login, Bucket and Region have to be configured.');
}
$user = $params['user'];