aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/External/MountProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/External/MountProvider.php')
-rw-r--r--apps/files_sharing/lib/External/MountProvider.php49
1 files changed, 13 insertions, 36 deletions
diff --git a/apps/files_sharing/lib/External/MountProvider.php b/apps/files_sharing/lib/External/MountProvider.php
index 169bf6ed3d7..a5781d5d35a 100644
--- a/apps/files_sharing/lib/External/MountProvider.php
+++ b/apps/files_sharing/lib/External/MountProvider.php
@@ -1,26 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @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: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\Files_Sharing\External;
@@ -28,36 +11,30 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Federation\ICloudIdManager;
use OCP\Files\Config\IMountProvider;
use OCP\Files\Storage\IStorageFactory;
+use OCP\Http\Client\IClientService;
use OCP\IDBConnection;
use OCP\IUser;
+use OCP\Server;
class MountProvider implements IMountProvider {
public const STORAGE = '\OCA\Files_Sharing\External\Storage';
/**
- * @var \OCP\IDBConnection
- */
- private $connection;
-
- /**
* @var callable
*/
private $managerProvider;
/**
- * @var ICloudIdManager
- */
- private $cloudIdManager;
-
- /**
- * @param \OCP\IDBConnection $connection
+ * @param IDBConnection $connection
* @param callable $managerProvider due to setup order we need a callable that return the manager instead of the manager itself
* @param ICloudIdManager $cloudIdManager
*/
- public function __construct(IDBConnection $connection, callable $managerProvider, ICloudIdManager $cloudIdManager) {
- $this->connection = $connection;
+ public function __construct(
+ private IDBConnection $connection,
+ callable $managerProvider,
+ private ICloudIdManager $cloudIdManager,
+ ) {
$this->managerProvider = $managerProvider;
- $this->cloudIdManager = $cloudIdManager;
}
public function getMount(IUser $user, $data, IStorageFactory $storageFactory) {
@@ -68,7 +45,7 @@ class MountProvider implements IMountProvider {
$data['mountpoint'] = $mountPoint;
$data['cloudId'] = $this->cloudIdManager->getCloudId($data['owner'], $data['remote']);
$data['certificateManager'] = \OC::$server->getCertificateManager();
- $data['HttpClientService'] = \OC::$server->getHTTPClientService();
+ $data['HttpClientService'] = Server::get(IClientService::class);
return new Mount(self::STORAGE, $mountPoint, $data, $manager, $storageFactory);
}