diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index beb3d02749dd4..1446d426665c3 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -423,11 +423,11 @@ 'OCP\\Files\\Config\\ICachedMountInfo' => $baseDir . '/lib/public/Files/Config/ICachedMountInfo.php', 'OCP\\Files\\Config\\IHomeMountProvider' => $baseDir . '/lib/public/Files/Config/IHomeMountProvider.php', 'OCP\\Files\\Config\\IMountProvider' => $baseDir . '/lib/public/Files/Config/IMountProvider.php', - 'OCP\\Files\\Config\\IMountProviderArgs' => $baseDir . '/lib/public/Files/Config/IMountProviderArgs.php', 'OCP\\Files\\Config\\IMountProviderCollection' => $baseDir . '/lib/public/Files/Config/IMountProviderCollection.php', 'OCP\\Files\\Config\\IPartialMountProvider' => $baseDir . '/lib/public/Files/Config/IPartialMountProvider.php', 'OCP\\Files\\Config\\IRootMountProvider' => $baseDir . '/lib/public/Files/Config/IRootMountProvider.php', 'OCP\\Files\\Config\\IUserMountCache' => $baseDir . '/lib/public/Files/Config/IUserMountCache.php', + 'OCP\\Files\\Config\\MountProviderArgs' => $baseDir . '/lib/public/Files/Config/MountProviderArgs.php', 'OCP\\Files\\ConnectionLostException' => $baseDir . '/lib/public/Files/ConnectionLostException.php', 'OCP\\Files\\Conversion\\ConversionMimeProvider' => $baseDir . '/lib/public/Files/Conversion/ConversionMimeProvider.php', 'OCP\\Files\\Conversion\\IConversionManager' => $baseDir . '/lib/public/Files/Conversion/IConversionManager.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index ff0f8b124ba7e..0c6bcd1baaa7e 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -464,11 +464,11 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Files\\Config\\ICachedMountInfo' => __DIR__ . '/../../..' . '/lib/public/Files/Config/ICachedMountInfo.php', 'OCP\\Files\\Config\\IHomeMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IHomeMountProvider.php', 'OCP\\Files\\Config\\IMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProvider.php', - 'OCP\\Files\\Config\\IMountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderArgs.php', 'OCP\\Files\\Config\\IMountProviderCollection' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderCollection.php', 'OCP\\Files\\Config\\IPartialMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IPartialMountProvider.php', 'OCP\\Files\\Config\\IRootMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IRootMountProvider.php', 'OCP\\Files\\Config\\IUserMountCache' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IUserMountCache.php', + 'OCP\\Files\\Config\\MountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/MountProviderArgs.php', 'OCP\\Files\\ConnectionLostException' => __DIR__ . '/../../..' . '/lib/public/Files/ConnectionLostException.php', 'OCP\\Files\\Conversion\\ConversionMimeProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Conversion/ConversionMimeProvider.php', 'OCP\\Files\\Conversion\\IConversionManager' => __DIR__ . '/../../..' . '/lib/public/Files/Conversion/IConversionManager.php', diff --git a/lib/private/Files/Config/MountProviderCollection.php b/lib/private/Files/Config/MountProviderCollection.php index 9f4c52bd54026..446027a96f1b2 100644 --- a/lib/private/Files/Config/MountProviderCollection.php +++ b/lib/private/Files/Config/MountProviderCollection.php @@ -13,11 +13,11 @@ use OCP\Diagnostics\IEventLogger; use OCP\Files\Config\IHomeMountProvider; use OCP\Files\Config\IMountProvider; -use OCP\Files\Config\IMountProviderArgs; use OCP\Files\Config\IMountProviderCollection; use OCP\Files\Config\IPartialMountProvider; use OCP\Files\Config\IRootMountProvider; use OCP\Files\Config\IUserMountCache; +use OCP\Files\Config\MountProviderArgs; use OCP\Files\Mount\IMountManager; use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage\IStorageFactory; @@ -84,7 +84,7 @@ public function getMountsForUser(IUser $user): array { } /** - * @param IMountProviderArgs[] $mountProviderArgs + * @param MountProviderArgs[] $mountProviderArgs * @return array IMountPoint array indexed by mount * point. */ diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index 7f8bc2ed5485b..32943aaed2925 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -34,10 +34,10 @@ use OCP\Files\Config\ICachedMountInfo; use OCP\Files\Config\IHomeMountProvider; use OCP\Files\Config\IMountProvider; -use OCP\Files\Config\IMountProviderArgs; use OCP\Files\Config\IPartialMountProvider; use OCP\Files\Config\IRootMountProvider; use OCP\Files\Config\IUserMountCache; +use OCP\Files\Config\MountProviderArgs; use OCP\Files\Events\BeforeFileSystemSetupEvent; use OCP\Files\Events\InvalidateMountCacheEvent; use OCP\Files\Events\Node\BeforeNodeRenamedEvent; @@ -482,7 +482,7 @@ public function setupForPath(string $path, bool $includeChildren = false): void if (is_a($mountProvider, IPartialMountProvider::class, true)) { $rootId = $cachedMount->getRootId(); $rootMetadata = $this->fileAccess->getByFileId($rootId); - $providerArgs = new IMountProviderArgs($cachedMount, $rootMetadata); + $providerArgs = new MountProviderArgs($cachedMount, $rootMetadata); // mark the path as cached (without children for now...) $this->setupMountProviderPaths[$mountPoint] = self::SETUP_WITHOUT_CHILDREN; $authoritativeMounts[] = array_values( @@ -568,7 +568,7 @@ static function (ICachedMountInfo $info) use ($rootsMetadata) { $rootMetadata = $rootsMetadata[$info->getRootId()] ?? null; return $rootMetadata - ? new IMountProviderArgs($info, $rootMetadata) + ? new MountProviderArgs($info, $rootMetadata) : null; }, $cachedMounts diff --git a/lib/public/Files/Config/IPartialMountProvider.php b/lib/public/Files/Config/IPartialMountProvider.php index 0ebb3413e1a66..8425c3fd32ed3 100644 --- a/lib/public/Files/Config/IPartialMountProvider.php +++ b/lib/public/Files/Config/IPartialMountProvider.php @@ -26,12 +26,12 @@ interface IPartialMountProvider extends IMountProvider { * as well as information about mount points known to be provided by the * mount provider and contained in the path or in its sub-paths. * - * Implementations should verify the IMountProviderArgs and return the + * Implementations should verify the MountProviderArgs and return the * corresponding IMountPoint instances. * * @param string $path path for which the mounts are set up * @param bool $forChildren when true, only child mounts for path should be returned - * @param IMountProviderArgs[] $mountProviderArgs + * @param MountProviderArgs[] $mountProviderArgs * @param IStorageFactory $loader * @return array IMountPoint instances, indexed by * mount-point diff --git a/lib/public/Files/Config/IMountProviderArgs.php b/lib/public/Files/Config/MountProviderArgs.php similarity index 75% rename from lib/public/Files/Config/IMountProviderArgs.php rename to lib/public/Files/Config/MountProviderArgs.php index b4c848f5f38ec..bc44603dcb91d 100644 --- a/lib/public/Files/Config/IMountProviderArgs.php +++ b/lib/public/Files/Config/MountProviderArgs.php @@ -15,10 +15,10 @@ * * @since 33.0.0 */ -class IMountProviderArgs { +class MountProviderArgs { public function __construct( - public ICachedMountInfo $mountInfo, - public ICacheEntry $cacheEntry, + public readonly ICachedMountInfo $mountInfo, + public readonly ICacheEntry $cacheEntry, ) { } } diff --git a/tests/lib/Files/SetupManagerTest.php b/tests/lib/Files/SetupManagerTest.php index 208257db6e26e..673b0fc738cbc 100644 --- a/tests/lib/Files/SetupManagerTest.php +++ b/tests/lib/Files/SetupManagerTest.php @@ -17,9 +17,9 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\ICachedMountInfo; use OCP\Files\Config\IMountProvider; -use OCP\Files\Config\IMountProviderArgs; use OCP\Files\Config\IPartialMountProvider; use OCP\Files\Config\IUserMountCache; +use OCP\Files\Config\MountProviderArgs; use OCP\Files\Mount\IMountManager; use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage\IStorageFactory; @@ -147,7 +147,7 @@ public function testSetupForPathWithPartialProviderSkipsAlreadySetupPath(): void false, $this->callback(function (array $args) use ($cachedMount) { $this->assertCount(1, $args); - $this->assertInstanceOf(IMountProviderArgs::class, $args[0]); + $this->assertInstanceOf(MountProviderArgs::class, $args[0]); $this->assertSame($cachedMount, $args[0]->mountInfo); return true; }) @@ -366,7 +366,7 @@ public function testSetupForPathWithChildrenAndPartialProviderSkipsIfParentAlrea $this->assertSame($expectedPath, $pathArg); $this->assertSame($expectedForChildren, $forChildren); $this->assertCount(1, $mountProviderArgs); - $this->assertInstanceOf(IMountProviderArgs::class, $mountProviderArgs[0]); + $this->assertInstanceOf(MountProviderArgs::class, $mountProviderArgs[0]); $this->assertSame($expectedCachedMount, $mountProviderArgs[0]->mountInfo); return $mountPoints; @@ -468,7 +468,7 @@ public function testSetupForPathHandlesPartialAndFullProvidersWithChildren(): vo $this->assertSame($expectedPath, $pathArg); $this->assertSame($expectedForChildren, $forChildren); $this->assertCount(1, $mountProviderArgs); - $this->assertInstanceOf(IMountProviderArgs::class, $mountProviderArgs[0]); + $this->assertInstanceOf(MountProviderArgs::class, $mountProviderArgs[0]); $this->assertSame($expectedCachedMount, $mountProviderArgs[0]->mountInfo); return $mountPoints; @@ -520,7 +520,7 @@ public function testSetupForUserResetsUserPaths(): void { false, $this->callback(function (array $args) use ($cachedMount) { $this->assertCount(1, $args); - $this->assertInstanceOf(IMountProviderArgs::class, + $this->assertInstanceOf(MountProviderArgs::class, $args[0]); $this->assertSame($cachedMount, $args[0]->mountInfo); return true; @@ -589,7 +589,7 @@ public function testSetupForProviderResetsUserProviderPaths(): void { false, $this->callback(function (array $args) use ($cachedMount) { $this->assertCount(1, $args); - $this->assertInstanceOf(IMountProviderArgs::class, + $this->assertInstanceOf(MountProviderArgs::class, $args[0]); $this->assertSame($cachedMount, $args[0]->mountInfo); return true;