Skip to content

Commit 7b05c8f

Browse files
committed
refactor(files): Rename IMountProviderArgs
It's not an interface so the I-prefix is inadequate. Signed-off-by: Carl Schwan <carlschwan@kde.org>
1 parent 89166cb commit 7b05c8f

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
@@ -423,11 +423,11 @@
423423
'OCP\\Files\\Config\\ICachedMountInfo' => $baseDir . '/lib/public/Files/Config/ICachedMountInfo.php',
424424
'OCP\\Files\\Config\\IHomeMountProvider' => $baseDir . '/lib/public/Files/Config/IHomeMountProvider.php',
425425
'OCP\\Files\\Config\\IMountProvider' => $baseDir . '/lib/public/Files/Config/IMountProvider.php',
426-
'OCP\\Files\\Config\\IMountProviderArgs' => $baseDir . '/lib/public/Files/Config/IMountProviderArgs.php',
427426
'OCP\\Files\\Config\\IMountProviderCollection' => $baseDir . '/lib/public/Files/Config/IMountProviderCollection.php',
428427
'OCP\\Files\\Config\\IPartialMountProvider' => $baseDir . '/lib/public/Files/Config/IPartialMountProvider.php',
429428
'OCP\\Files\\Config\\IRootMountProvider' => $baseDir . '/lib/public/Files/Config/IRootMountProvider.php',
430429
'OCP\\Files\\Config\\IUserMountCache' => $baseDir . '/lib/public/Files/Config/IUserMountCache.php',
430+
'OCP\\Files\\Config\\MountProviderArgs' => $baseDir . '/lib/public/Files/Config/MountProviderArgs.php',
431431
'OCP\\Files\\ConnectionLostException' => $baseDir . '/lib/public/Files/ConnectionLostException.php',
432432
'OCP\\Files\\Conversion\\ConversionMimeProvider' => $baseDir . '/lib/public/Files/Conversion/ConversionMimeProvider.php',
433433
'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
@@ -464,11 +464,11 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
464464
'OCP\\Files\\Config\\ICachedMountInfo' => __DIR__ . '/../../..' . '/lib/public/Files/Config/ICachedMountInfo.php',
465465
'OCP\\Files\\Config\\IHomeMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IHomeMountProvider.php',
466466
'OCP\\Files\\Config\\IMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProvider.php',
467-
'OCP\\Files\\Config\\IMountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderArgs.php',
468467
'OCP\\Files\\Config\\IMountProviderCollection' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IMountProviderCollection.php',
469468
'OCP\\Files\\Config\\IPartialMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IPartialMountProvider.php',
470469
'OCP\\Files\\Config\\IRootMountProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IRootMountProvider.php',
471470
'OCP\\Files\\Config\\IUserMountCache' => __DIR__ . '/../../..' . '/lib/public/Files/Config/IUserMountCache.php',
471+
'OCP\\Files\\Config\\MountProviderArgs' => __DIR__ . '/../../..' . '/lib/public/Files/Config/MountProviderArgs.php',
472472
'OCP\\Files\\ConnectionLostException' => __DIR__ . '/../../..' . '/lib/public/Files/ConnectionLostException.php',
473473
'OCP\\Files\\Conversion\\ConversionMimeProvider' => __DIR__ . '/../../..' . '/lib/public/Files/Conversion/ConversionMimeProvider.php',
474474
'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
@@ -34,10 +34,10 @@
3434
use OCP\Files\Config\ICachedMountInfo;
3535
use OCP\Files\Config\IHomeMountProvider;
3636
use OCP\Files\Config\IMountProvider;
37-
use OCP\Files\Config\IMountProviderArgs;
3837
use OCP\Files\Config\IPartialMountProvider;
3938
use OCP\Files\Config\IRootMountProvider;
4039
use OCP\Files\Config\IUserMountCache;
40+
use OCP\Files\Config\MountProviderArgs;
4141
use OCP\Files\Events\BeforeFileSystemSetupEvent;
4242
use OCP\Files\Events\InvalidateMountCacheEvent;
4343
use OCP\Files\Events\Node\BeforeNodeRenamedEvent;
@@ -482,7 +482,7 @@ public function setupForPath(string $path, bool $includeChildren = false): void
482482
if (is_a($mountProvider, IPartialMountProvider::class, true)) {
483483
$rootId = $cachedMount->getRootId();
484484
$rootMetadata = $this->fileAccess->getByFileId($rootId);
485-
$providerArgs = new IMountProviderArgs($cachedMount, $rootMetadata);
485+
$providerArgs = new MountProviderArgs($cachedMount, $rootMetadata);
486486
// mark the path as cached (without children for now...)
487487
$this->setupMountProviderPaths[$mountPoint] = self::SETUP_WITHOUT_CHILDREN;
488488
$authoritativeMounts[] = array_values(
@@ -568,7 +568,7 @@ static function (ICachedMountInfo $info) use ($rootsMetadata) {
568568
$rootMetadata = $rootsMetadata[$info->getRootId()] ?? null;
569569

570570
return $rootMetadata
571-
? new IMountProviderArgs($info, $rootMetadata)
571+
? new MountProviderArgs($info, $rootMetadata)
572572
: null;
573573
},
574574
$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)