* @param string $mountType hook mount type param
* @param array $applicableArray array of applicable users/groups for which to trigger the hook
*/
- protected function triggerApplicableHooks($signal, $mountPoint, $mountType, $applicableArray) {
+ protected function triggerApplicableHooks($signal, $mountPoint, $mountType, $applicableArray): void {
$this->eventDispatcher->dispatchTyped(new InvalidateMountCacheEvent(null));
foreach ($applicableArray as $applicable) {
\OCP\Util::emitHook(
* @param IMountProvider[] $providers
* @return IMountPoint[]
*/
- private function getMountsForFromProviders(IUser $user, array $providers): array {
+ private function getUserMountsForProviders(IUser $user, array $providers): array {
$loader = $this->loader;
$mounts = array_map(function (IMountProvider $provider) use ($user, $loader) {
return $provider->getMountsForUser($user, $loader);
}
public function getMountsForUser(IUser $user): array {
- return $this->getMountsForFromProviders($user, $this->providers);
+ return $this->getUserMountsForProviders($user, $this->providers);
}
- public function getMountsFromProvider(IUser $user, string $mountProviderClass): array {
- $providers = array_filter($this->providers, function (IMountProvider $mountProvider) use ($mountProviderClass) {
- return get_class($mountProvider) === $mountProviderClass;
- });
- return $this->getMountsForFromProviders($user, $providers);
+ public function getUserMountsForProviderClass(IUser $user, string $mountProviderClass): array {
+ $providers = array_filter(
+ $this->providers,
+ fn (IMountProvider $mountProvider) => (get_class($mountProvider) === $mountProviderClass)
+ );
+ return $this->getUserMountsForProviders($user, $providers);
}
public function addMountForUser(IUser $user, IMountManager $mountManager, callable $providerFilter = null) {
$setupProviders[] = $cachedMount->getMountProvider();
$currentProviders[] = $cachedMount->getMountProvider();
if ($cachedMount->getMountProvider()) {
- $mounts = $this->mountProviderCollection->getMountsFromProvider($user, $cachedMount->getMountProvider());
+ $mounts = $this->mountProviderCollection->getUserMountsForProviderClass($user, $cachedMount->getMountProvider());
} else {
$this->logger->debug("mount at " . $cachedMount->getMountPoint() . " has no provider set, performing full setup");
$this->setupForUser($user);
$setupProviders[] = $cachedMount->getMountProvider();
$currentProviders[] = $cachedMount->getMountProvider();
if ($cachedMount->getMountProvider()) {
- $mounts = array_merge($mounts, $this->mountProviderCollection->getMountsFromProvider($user, $cachedMount->getMountProvider()));
+ $mounts = array_merge($mounts, $this->mountProviderCollection->getUserMountsForProviderClass($user, $cachedMount->getMountProvider()));
} else {
$this->logger->debug("mount at " . $cachedMount->getMountPoint() . " has no provider set, performing full setup");
$this->setupForUser($user);
* @return \OCP\Files\Mount\IMountPoint[]
* @since 24.0.0
*/
- public function getMountsFromProvider(IUser $user, string $mountProviderClass);
+ public function getUserMountsForProviderClass(IUser $user, string $mountProviderClass);
/**
* Get the configured home mount for this user