Skip to content

Commit abe5499

Browse files
Merge pull request #57498 from nextcloud/carl/rename-imountproviderargs
refactor(files): Rename IMountProviderArgs
2 parents 6a0e7e3 + 7b05c8f commit abe5499

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

lib/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,11 @@
424424
'OCP\\Files\\Config\\ICachedMountInfo' => $baseDir . '/lib/public/Files/Config/ICachedMountInfo.php',
425425
'OCP\\Files\\Config\\IHomeMountProvider' => $baseDir . '/lib/public/Files/Config/IHomeMountProvider.php',
426426
'OCP\\Files\\Config\\IMountProvider' => $baseDir . '/lib/public/Files/Config/IMountProvider.php',
427-
'OCP\\Files\\Config\\IMountProviderArgs' => $baseDir . '/lib/public/Files/Config/IMountProviderArgs.php',
428427
'OCP\\Files\\Config\\IMountProviderCollection' => $baseDir . '/lib/public/Files/Config/IMountProviderCollection.php',
429428
'OCP\\Files\\Config\\IPartialMountProvider' => $baseDir . '/lib/public/Files/Config/IPartialMountProvider.php',
430429
'OCP\\Files\\Config\\IRootMountProvider' => $baseDir . '/lib/public/Files/Config/IRootMountProvider.php',
431430
'OCP\\Files\\Config\\IUserMountCache' => $baseDir . '/lib/public/Files/Config/IUserMountCache.php',
431+
'OCP\\Files\\Config\\MountProviderArgs' => $baseDir . '/lib/public/Files/Config/MountProviderArgs.php',
432432
'OCP\\Files\\ConnectionLostException' => $baseDir . '/lib/public/Files/ConnectionLostException.php',
433433
'OCP\\Files\\Conversion\\ConversionMimeProvider' => $baseDir . '/lib/public/Files/Conversion/ConversionMimeProvider.php',
434434
'OCP\\Files\\Conversion\\IConversionManager' => $baseDir . '/lib/public/Files/Conversion/IConversionManager.php',

lib/composer/composer/autoload_static.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
465465
'OCP\\Files\\Config\\ICachedMountInfo' => __DIR__ . '/../../..' . '/lib/public/Files/Config/ICachedMountInfo.php',
466466
'OCP\\Files\\Config\\IHomeMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IHomeMountProvider.php',
467467
'OCP\\Files\\Config\\IMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProvider.php',
468-
'OCP\\Files\\Config\\IMountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderArgs.php',
469468
'OCP\\Files\\Config\\IMountProviderCollection' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderCollection.php',
470469
'OCP\\Files\\Config\\IPartialMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IPartialMountProvider.php',
471470
'OCP\\Files\\Config\\IRootMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IRootMountProvider.php',
472471
'OCP\\Files\\Config\\IUserMountCache' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IUserMountCache.php',
472+
'OCP\\Files\\Config\\MountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/MountProviderArgs.php',
473473
'OCP\\Files\\ConnectionLostException' => __DIR__ . '/../../..' . '/lib/public/Files/ConnectionLostException.php',
474474
'OCP\\Files\\Conversion\\ConversionMimeProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Conversion/ConversionMimeProvider.php',
475475
'OCP\\Files\\Conversion\\IConversionManager' => __DIR__ . '/../../..' . '/lib/public/Files/Conversion/IConversionManager.php',

lib/private/Files/Config/MountProviderCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
use OCP\Diagnostics\IEventLogger;
1414
use OCP\Files\Config\IHomeMountProvider;
1515
use OCP\Files\Config\IMountProvider;
16-
use OCP\Files\Config\IMountProviderArgs;
1716
use OCP\Files\Config\IMountProviderCollection;
1817
use OCP\Files\Config\IPartialMountProvider;
1918
use OCP\Files\Config\IRootMountProvider;
2019
use OCP\Files\Config\IUserMountCache;
20+
use OCP\Files\Config\MountProviderArgs;
2121
use OCP\Files\Mount\IMountManager;
2222
use OCP\Files\Mount\IMountPoint;
2323
use OCP\Files\Storage\IStorageFactory;
@@ -84,7 +84,7 @@ public function getMountsForUser(IUser $user): array {
8484
}
8585

8686
/**
87-
* @param IMountProviderArgs[] $mountProviderArgs
87+
* @param MountProviderArgs[] $mountProviderArgs
8888
* @return array<string, IMountPoint> IMountPoint array indexed by mount
8989
* point.
9090
*/

lib/private/Files/SetupManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
use OCP\Files\Config\ICachedMountInfo;
3636
use OCP\Files\Config\IHomeMountProvider;
3737
use OCP\Files\Config\IMountProvider;
38-
use OCP\Files\Config\IMountProviderArgs;
3938
use OCP\Files\Config\IPartialMountProvider;
4039
use OCP\Files\Config\IRootMountProvider;
4140
use OCP\Files\Config\IUserMountCache;
41+
use OCP\Files\Config\MountProviderArgs;
4242
use OCP\Files\Events\BeforeFileSystemSetupEvent;
4343
use OCP\Files\Events\InvalidateMountCacheEvent;
4444
use OCP\Files\Events\Node\BeforeNodeRenamedEvent;
@@ -521,7 +521,7 @@ public function setupForPath(string $path, bool $includeChildren = false): void
521521
if (is_a($mountProvider, IPartialMountProvider::class, true)) {
522522
$rootId = $cachedMount->getRootId();
523523
$rootMetadata = $this->fileAccess->getByFileId($rootId);
524-
$providerArgs = new IMountProviderArgs($cachedMount, $rootMetadata);
524+
$providerArgs = new MountProviderArgs($cachedMount, $rootMetadata);
525525
// mark the path as cached (without children for now...)
526526
$this->setupMountProviderPaths[$mountPoint] = self::SETUP_WITHOUT_CHILDREN;
527527
$authoritativeMounts[] = array_values(
@@ -605,7 +605,7 @@ static function (ICachedMountInfo $info) use ($rootsMetadata) {
605605
$rootMetadata = $rootsMetadata[$info->getRootId()] ?? null;
606606

607607
return $rootMetadata
608-
? new IMountProviderArgs($info, $rootMetadata)
608+
? new MountProviderArgs($info, $rootMetadata)
609609
: null;
610610
},
611611
$cachedMounts

lib/public/Files/Config/IPartialMountProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ interface IPartialMountProvider extends IMountProvider {
2626
* as well as information about mount points known to be provided by the
2727
* mount provider and contained in the path or in its sub-paths.
2828
*
29-
* Implementations should verify the IMountProviderArgs and return the
29+
* Implementations should verify the MountProviderArgs and return the
3030
* corresponding IMountPoint instances.
3131
*
3232
* @param string $path path for which the mounts are set up
3333
* @param bool $forChildren when true, only child mounts for path should be returned
34-
* @param IMountProviderArgs[] $mountProviderArgs
34+
* @param MountProviderArgs[] $mountProviderArgs
3535
* @param IStorageFactory $loader
3636
* @return array<string, IMountPoint> IMountPoint instances, indexed by
3737
* mount-point

lib/public/Files/Config/IMountProviderArgs.php renamed to lib/public/Files/Config/MountProviderArgs.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*
1616
* @since 33.0.0
1717
*/
18-
class IMountProviderArgs {
18+
class MountProviderArgs {
1919
public function __construct(
20-
public ICachedMountInfo $mountInfo,
21-
public ICacheEntry $cacheEntry,
20+
public readonly ICachedMountInfo $mountInfo,
21+
public readonly ICacheEntry $cacheEntry,
2222
) {
2323
}
2424
}

tests/lib/Files/SetupManagerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
use OCP\EventDispatcher\IEventDispatcher;
1818
use OCP\Files\Config\ICachedMountInfo;
1919
use OCP\Files\Config\IMountProvider;
20-
use OCP\Files\Config\IMountProviderArgs;
2120
use OCP\Files\Config\IPartialMountProvider;
2221
use OCP\Files\Config\IUserMountCache;
22+
use OCP\Files\Config\MountProviderArgs;
2323
use OCP\Files\Mount\IMountManager;
2424
use OCP\Files\Mount\IMountPoint;
2525
use OCP\Files\Storage\IStorageFactory;
@@ -147,7 +147,7 @@ public function testSetupForPathWithPartialProviderSkipsAlreadySetupPath(): void
147147
false,
148148
$this->callback(function (array $args) use ($cachedMount) {
149149
$this->assertCount(1, $args);
150-
$this->assertInstanceOf(IMountProviderArgs::class, $args[0]);
150+
$this->assertInstanceOf(MountProviderArgs::class, $args[0]);
151151
$this->assertSame($cachedMount, $args[0]->mountInfo);
152152
return true;
153153
})
@@ -366,7 +366,7 @@ public function testSetupForPathWithChildrenAndPartialProviderSkipsIfParentAlrea
366366
$this->assertSame($expectedPath, $pathArg);
367367
$this->assertSame($expectedForChildren, $forChildren);
368368
$this->assertCount(1, $mountProviderArgs);
369-
$this->assertInstanceOf(IMountProviderArgs::class, $mountProviderArgs[0]);
369+
$this->assertInstanceOf(MountProviderArgs::class, $mountProviderArgs[0]);
370370
$this->assertSame($expectedCachedMount, $mountProviderArgs[0]->mountInfo);
371371

372372
return $mountPoints;
@@ -468,7 +468,7 @@ public function testSetupForPathHandlesPartialAndFullProvidersWithChildren(): vo
468468
$this->assertSame($expectedPath, $pathArg);
469469
$this->assertSame($expectedForChildren, $forChildren);
470470
$this->assertCount(1, $mountProviderArgs);
471-
$this->assertInstanceOf(IMountProviderArgs::class, $mountProviderArgs[0]);
471+
$this->assertInstanceOf(MountProviderArgs::class, $mountProviderArgs[0]);
472472
$this->assertSame($expectedCachedMount, $mountProviderArgs[0]->mountInfo);
473473

474474
return $mountPoints;
@@ -520,7 +520,7 @@ public function testSetupForUserResetsUserPaths(): void {
520520
false,
521521
$this->callback(function (array $args) use ($cachedMount) {
522522
$this->assertCount(1, $args);
523-
$this->assertInstanceOf(IMountProviderArgs::class,
523+
$this->assertInstanceOf(MountProviderArgs::class,
524524
$args[0]);
525525
$this->assertSame($cachedMount, $args[0]->mountInfo);
526526
return true;
@@ -589,7 +589,7 @@ public function testSetupForProviderResetsUserProviderPaths(): void {
589589
false,
590590
$this->callback(function (array $args) use ($cachedMount) {
591591
$this->assertCount(1, $args);
592-
$this->assertInstanceOf(IMountProviderArgs::class,
592+
$this->assertInstanceOf(MountProviderArgs::class,
593593
$args[0]);
594594
$this->assertSame($cachedMount, $args[0]->mountInfo);
595595
return true;

0 commit comments

Comments
 (0)