aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Storage/SFTP.php
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-10-08 15:13:16 +0200
committerKate <26026535+provokateurin@users.noreply.github.com>2024-10-23 13:24:18 +0200
commit0de4843b73ee4779c7e455dd80c36a6b506e0024 (patch)
tree67ad68f0b4c925a65b029bdfcaafe5681c527d3a /apps/files_external/lib/Lib/Storage/SFTP.php
parent74cd6e295a8e2e7c64e4fe38ba775986c57509a4 (diff)
downloadnextcloud-server-0de4843b73ee4779c7e455dd80c36a6b506e0024.tar.gz
nextcloud-server-0de4843b73ee4779c7e455dd80c36a6b506e0024.zip
refactor(Storage): Align all Storage constructorsrefactor/storage/constructors
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/SFTP.php')
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index c430cc2b5fd..44073beedec 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -57,25 +57,25 @@ class SFTP extends Common {
}
}
- public function __construct($params) {
+ public function __construct(array $parameters) {
// Register sftp://
Stream::register();
- $parsedHost = $this->splitHost($params['host']);
+ $parsedHost = $this->splitHost($parameters['host']);
$this->host = $parsedHost[0];
$this->port = $parsedHost[1];
- if (!isset($params['user'])) {
+ if (!isset($parameters['user'])) {
throw new \UnexpectedValueException('no authentication parameters specified');
}
- $this->user = $params['user'];
+ $this->user = $parameters['user'];
- if (isset($params['public_key_auth'])) {
- $this->auth[] = $params['public_key_auth'];
+ if (isset($parameters['public_key_auth'])) {
+ $this->auth[] = $parameters['public_key_auth'];
}
- if (isset($params['password']) && $params['password'] !== '') {
- $this->auth[] = $params['password'];
+ if (isset($parameters['password']) && $parameters['password'] !== '') {
+ $this->auth[] = $parameters['password'];
}
if ($this->auth === []) {
@@ -83,7 +83,7 @@ class SFTP extends Common {
}
$this->root
- = isset($params['root']) ? $this->cleanPath($params['root']) : '/';
+ = isset($parameters['root']) ? $this->cleanPath($parameters['root']) : '/';
$this->root = '/' . ltrim($this->root, '/');
$this->root = rtrim($this->root, '/') . '/';