aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore
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 /lib/private/Files/ObjectStore
parent74cd6e295a8e2e7c64e4fe38ba775986c57509a4 (diff)
downloadnextcloud-server-refactor/storage/constructors.tar.gz
nextcloud-server-refactor/storage/constructors.zip
refactor(Storage): Align all Storage constructorsrefactor/storage/constructors
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib/private/Files/ObjectStore')
-rw-r--r--lib/private/Files/ObjectStore/AppdataPreviewObjectStoreStorage.php10
-rw-r--r--lib/private/Files/ObjectStore/Azure.php2
-rw-r--r--lib/private/Files/ObjectStore/HomeObjectStoreStorage.php10
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php22
-rw-r--r--lib/private/Files/ObjectStore/S3.php2
5 files changed, 23 insertions, 23 deletions
diff --git a/lib/private/Files/ObjectStore/AppdataPreviewObjectStoreStorage.php b/lib/private/Files/ObjectStore/AppdataPreviewObjectStoreStorage.php
index 66fa74172d3..aaaee044bac 100644
--- a/lib/private/Files/ObjectStore/AppdataPreviewObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/AppdataPreviewObjectStoreStorage.php
@@ -12,15 +12,15 @@ class AppdataPreviewObjectStoreStorage extends ObjectStoreStorage {
private string $internalId;
/**
- * @param array $params
+ * @param array $parameters
* @throws \Exception
*/
- public function __construct($params) {
- if (!isset($params['internal-id'])) {
+ public function __construct(array $parameters) {
+ if (!isset($parameters['internal-id'])) {
throw new \Exception('missing id in parameters');
}
- $this->internalId = (string)$params['internal-id'];
- parent::__construct($params);
+ $this->internalId = (string)$parameters['internal-id'];
+ parent::__construct($parameters);
}
public function getId(): string {
diff --git a/lib/private/Files/ObjectStore/Azure.php b/lib/private/Files/ObjectStore/Azure.php
index 2dacdac1f8d..575cc336ba8 100644
--- a/lib/private/Files/ObjectStore/Azure.php
+++ b/lib/private/Files/ObjectStore/Azure.php
@@ -27,7 +27,7 @@ class Azure implements IObjectStore {
/**
* @param array $parameters
*/
- public function __construct($parameters) {
+ public function __construct(array $parameters) {
$this->containerName = $parameters['container'];
$this->accountName = $parameters['account_name'];
$this->accountKey = $parameters['account_key'];
diff --git a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php
index eb95c0b4bf7..4e2d10705fe 100644
--- a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php
@@ -17,15 +17,15 @@ class HomeObjectStoreStorage extends ObjectStoreStorage implements IHomeStorage
/**
* The home user storage requires a user object to create a unique storage id
*
- * @param array $params
+ * @param array $parameters
* @throws Exception
*/
- public function __construct($params) {
- if (! isset($params['user']) || ! $params['user'] instanceof IUser) {
+ public function __construct(array $parameters) {
+ if (! isset($parameters['user']) || ! $parameters['user'] instanceof IUser) {
throw new Exception('missing user object in parameters');
}
- $this->user = $params['user'];
- parent::__construct($params);
+ $this->user = $parameters['user'];
+ parent::__construct($parameters);
}
public function getId(): string {
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index b07b6955b1a..0963ffbb28f 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -41,27 +41,27 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
private bool $preserveCacheItemsOnDelete = false;
/**
- * @param array $params
+ * @param array $parameters
* @throws \Exception
*/
- public function __construct($params) {
- if (isset($params['objectstore']) && $params['objectstore'] instanceof IObjectStore) {
- $this->objectStore = $params['objectstore'];
+ public function __construct(array $parameters) {
+ if (isset($parameters['objectstore']) && $parameters['objectstore'] instanceof IObjectStore) {
+ $this->objectStore = $parameters['objectstore'];
} else {
throw new \Exception('missing IObjectStore instance');
}
- if (isset($params['storageid'])) {
- $this->id = 'object::store:' . $params['storageid'];
+ if (isset($parameters['storageid'])) {
+ $this->id = 'object::store:' . $parameters['storageid'];
} else {
$this->id = 'object::store:' . $this->objectStore->getStorageId();
}
- if (isset($params['objectPrefix'])) {
- $this->objectPrefix = $params['objectPrefix'];
+ if (isset($parameters['objectPrefix'])) {
+ $this->objectPrefix = $parameters['objectPrefix'];
}
- if (isset($params['validateWrites'])) {
- $this->validateWrites = (bool)$params['validateWrites'];
+ if (isset($parameters['validateWrites'])) {
+ $this->validateWrites = (bool)$parameters['validateWrites'];
}
- $this->handleCopiesAsOwned = (bool)($params['handleCopiesAsOwned'] ?? false);
+ $this->handleCopiesAsOwned = (bool)($parameters['handleCopiesAsOwned'] ?? false);
$this->logger = \OCP\Server::get(LoggerInterface::class);
}
diff --git a/lib/private/Files/ObjectStore/S3.php b/lib/private/Files/ObjectStore/S3.php
index 72c19d951e4..41ab75caf45 100644
--- a/lib/private/Files/ObjectStore/S3.php
+++ b/lib/private/Files/ObjectStore/S3.php
@@ -14,7 +14,7 @@ class S3 implements IObjectStore, IObjectStoreMultiPartUpload {
use S3ConnectionTrait;
use S3ObjectTrait;
- public function __construct($parameters) {
+ public function __construct(array $parameters) {
$parameters['primary_storage'] = true;
$this->parseParams($parameters);
}