aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Config
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Config')
-rw-r--r--apps/files_external/lib/Config/ConfigAdapter.php6
-rw-r--r--apps/files_external/lib/Config/ExternalMountPoint.php14
-rw-r--r--apps/files_external/lib/Config/UserContext.php25
3 files changed, 20 insertions, 25 deletions
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php
index be435d4de2f..c84fbb19102 100644
--- a/apps/files_external/lib/Config/ConfigAdapter.php
+++ b/apps/files_external/lib/Config/ConfigAdapter.php
@@ -15,7 +15,9 @@ use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\MountConfig;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
+use OCP\AppFramework\QueryException;
use OCP\Files\Config\IMountProvider;
+use OCP\Files\Mount\IMountPoint;
use OCP\Files\ObjectStore\IObjectStore;
use OCP\Files\Storage\IConstructableStorage;
use OCP\Files\Storage\IStorage;
@@ -40,7 +42,7 @@ class ConfigAdapter implements IMountProvider {
/**
* Process storage ready for mounting
*
- * @throws \OCP\AppFramework\QueryException
+ * @throws QueryException
*/
private function prepareStorageConfig(StorageConfig &$storage, IUser $user): void {
foreach ($storage->getBackendOptions() as $option => $value) {
@@ -82,7 +84,7 @@ class ConfigAdapter implements IMountProvider {
/**
* Get all mountpoints applicable for the user
*
- * @return \OCP\Files\Mount\IMountPoint[]
+ * @return IMountPoint[]
*/
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
$this->userStoragesService->setUser($user);
diff --git a/apps/files_external/lib/Config/ExternalMountPoint.php b/apps/files_external/lib/Config/ExternalMountPoint.php
index fea1976780e..0dc2eab5120 100644
--- a/apps/files_external/lib/Config/ExternalMountPoint.php
+++ b/apps/files_external/lib/Config/ExternalMountPoint.php
@@ -11,11 +11,15 @@ use OCA\Files_External\Lib\StorageConfig;
class ExternalMountPoint extends MountPoint {
- /** @var StorageConfig */
- protected $storageConfig;
-
- public function __construct(StorageConfig $storageConfig, $storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) {
- $this->storageConfig = $storageConfig;
+ public function __construct(
+ protected StorageConfig $storageConfig,
+ $storage,
+ $mountpoint,
+ $arguments = null,
+ $loader = null,
+ $mountOptions = null,
+ $mountId = null,
+ ) {
parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId, ConfigAdapter::class);
}
diff --git a/apps/files_external/lib/Config/UserContext.php b/apps/files_external/lib/Config/UserContext.php
index 5d9d2910ea2..6fe679c60b2 100644
--- a/apps/files_external/lib/Config/UserContext.php
+++ b/apps/files_external/lib/Config/UserContext.php
@@ -14,26 +14,15 @@ use OCP\Share\IManager as ShareManager;
class UserContext {
- /** @var IUserSession */
- private $session;
-
- /** @var ShareManager */
- private $shareManager;
-
- /** @var IRequest */
- private $request;
-
/** @var string */
private $userId;
- /** @var IUserManager */
- private $userManager;
-
- public function __construct(IUserSession $session, ShareManager $manager, IRequest $request, IUserManager $userManager) {
- $this->session = $session;
- $this->shareManager = $manager;
- $this->request = $request;
- $this->userManager = $userManager;
+ public function __construct(
+ private IUserSession $session,
+ private ShareManager $shareManager,
+ private IRequest $request,
+ private IUserManager $userManager,
+ ) {
}
public function getSession(): IUserSession {
@@ -48,7 +37,7 @@ class UserContext {
if ($this->userId !== null) {
return $this->userId;
}
- if ($this->session && $this->session->getUser() !== null) {
+ if ($this->session->getUser() !== null) {
return $this->session->getUser()->getUID();
}
try {