aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/StorageConfig.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Lib/StorageConfig.php')
-rw-r--r--apps/files_external/lib/Lib/StorageConfig.php54
1 files changed, 18 insertions, 36 deletions
diff --git a/apps/files_external/lib/Lib/StorageConfig.php b/apps/files_external/lib/Lib/StorageConfig.php
index 9e89e8fcc99..2cb82d3790a 100644
--- a/apps/files_external/lib/Lib/StorageConfig.php
+++ b/apps/files_external/lib/Lib/StorageConfig.php
@@ -1,33 +1,13 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Jesús Macias <jmacias@solidgear.es>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Robin McCorkell <robin@mccorkell.me.uk>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Vincent Petry <vincent@nextcloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\Files_External\Lib;
+use OC\Files\Filesystem;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Auth\IUserProvided;
use OCA\Files_External\Lib\Backend\Backend;
@@ -40,6 +20,8 @@ use OCA\Files_External\ResponseDefinitions;
*/
class StorageConfig implements \JsonSerializable {
public const MOUNT_TYPE_ADMIN = 1;
+ public const MOUNT_TYPE_PERSONAL = 2;
+ /** @deprecated use MOUNT_TYPE_PERSONAL (full uppercase) instead */
public const MOUNT_TYPE_PERSONAl = 2;
/**
@@ -101,14 +83,14 @@ class StorageConfig implements \JsonSerializable {
/**
* List of users who have access to this storage
*
- * @var string[]
+ * @var list<string>
*/
private $applicableUsers = [];
/**
* List of groups that have access to this storage
*
- * @var string[]
+ * @var list<string>
*/
private $applicableGroups = [];
@@ -172,7 +154,7 @@ class StorageConfig implements \JsonSerializable {
* @param string $mountPoint path
*/
public function setMountPoint($mountPoint) {
- $this->mountPoint = \OC\Files\Filesystem::normalizePath($mountPoint);
+ $this->mountPoint = Filesystem::normalizePath($mountPoint);
}
/**
@@ -223,7 +205,7 @@ class StorageConfig implements \JsonSerializable {
foreach ($backendOptions as $key => $value) {
if (isset($parameters[$key])) {
switch ($parameters[$key]->getType()) {
- case \OCA\Files_External\Lib\DefinitionParameter::VALUE_BOOLEAN:
+ case DefinitionParameter::VALUE_BOOLEAN:
$value = (bool)$value;
break;
}
@@ -275,7 +257,7 @@ class StorageConfig implements \JsonSerializable {
/**
* Returns the users for which to mount this storage
*
- * @return string[] applicable users
+ * @return list<string> applicable users
*/
public function getApplicableUsers() {
return $this->applicableUsers;
@@ -284,7 +266,7 @@ class StorageConfig implements \JsonSerializable {
/**
* Sets the users for which to mount this storage
*
- * @param string[]|null $applicableUsers applicable users
+ * @param list<string>|null $applicableUsers applicable users
*/
public function setApplicableUsers($applicableUsers) {
if (is_null($applicableUsers)) {
@@ -296,7 +278,7 @@ class StorageConfig implements \JsonSerializable {
/**
* Returns the groups for which to mount this storage
*
- * @return string[] applicable groups
+ * @return list<string> applicable groups
*/
public function getApplicableGroups() {
return $this->applicableGroups;
@@ -305,7 +287,7 @@ class StorageConfig implements \JsonSerializable {
/**
* Sets the groups for which to mount this storage
*
- * @param string[]|null $applicableGroups applicable groups
+ * @param list<string>|null $applicableGroups applicable groups
*/
public function setApplicableGroups($applicableGroups) {
if (is_null($applicableGroups)) {
@@ -384,14 +366,14 @@ class StorageConfig implements \JsonSerializable {
}
/**
- * @return int self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAl
+ * @return int self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAL
*/
public function getType() {
return $this->type;
}
/**
- * @param int $type self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAl
+ * @param int $type self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAL
*/
public function setType($type) {
$this->type = $type;
@@ -435,7 +417,7 @@ class StorageConfig implements \JsonSerializable {
$result['statusMessage'] = $this->statusMessage;
}
$result['userProvided'] = $this->authMechanism instanceof IUserProvided;
- $result['type'] = ($this->getType() === self::MOUNT_TYPE_PERSONAl) ? 'personal': 'system';
+ $result['type'] = ($this->getType() === self::MOUNT_TYPE_PERSONAL) ? 'personal': 'system';
return $result;
}