From 33d6f1e9841e4b0cb73ba7d3c13ade069415c6f4 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 29 Jan 2026 01:45:48 +0100 Subject: [PATCH] refactor(CacheMountInfo): Use constructor paramater promotion Signed-off-by: Carl Schwan --- lib/private/Files/Config/CachedMountInfo.php | 44 +++++--------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/lib/private/Files/Config/CachedMountInfo.php b/lib/private/Files/Config/CachedMountInfo.php index 79dd6c6ea1d..74326eba725 100644 --- a/lib/private/Files/Config/CachedMountInfo.php +++ b/lib/private/Files/Config/CachedMountInfo.php @@ -13,45 +13,21 @@ use OCP\Files\Node; use OCP\IUser; class CachedMountInfo implements ICachedMountInfo { - protected IUser $user; - protected int $storageId; - protected int $rootId; - protected string $mountPoint; - protected ?int $mountId; - protected string $rootInternalPath; - protected string $mountProvider; protected string $key; - /** - * CachedMountInfo constructor. - * - * @param IUser $user - * @param int $storageId - * @param int $rootId - * @param string $mountPoint - * @param int|null $mountId - * @param string $rootInternalPath - */ public function __construct( - IUser $user, - int $storageId, - int $rootId, - string $mountPoint, - string $mountProvider, - ?int $mountId = null, - string $rootInternalPath = '', + protected IUser $user, + protected int $storageId, + protected int $rootId, + protected string $mountPoint, + protected string $mountProvider, + protected ?int $mountId = null, + protected string $rootInternalPath = '', ) { - $this->user = $user; - $this->storageId = $storageId; - $this->rootId = $rootId; - $this->mountPoint = $mountPoint; - $this->mountId = $mountId; - $this->rootInternalPath = $rootInternalPath; - if (strlen($mountProvider) > 128) { - throw new \Exception("Mount provider $mountProvider name exceeds the limit of 128 characters"); + if (strlen($this->mountProvider) > 128) { + throw new \Exception("Mount provider $this->mountProvider name exceeds the limit of 128 characters"); } - $this->mountProvider = $mountProvider; - $this->key = $rootId . '::' . $mountPoint; + $this->key = $this->rootId . '::' . $this->mountPoint; } /**