refactor: simplify code

replace array_reduce + array_merge with array_merge(...)
replace conditional assignment with ??=

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
pull/55072/head
Salvatore Martire 2025-09-04 12:22:04 +07:00
parent f47a586cdd
commit 9b519b4679
2 changed files with 2 additions and 7 deletions

@ -67,9 +67,7 @@ class MountProviderCollection implements IMountProviderCollection, Emitter {
$mounts = array_map(function (IMountProvider $provider) use ($user, $loader) {
return $this->getMountsFromProvider($provider, $user, $loader);
}, $providers);
$mounts = array_reduce($mounts, function (array $mounts, array $providerMounts) {
return array_merge($mounts, $providerMounts);
}, []);
$mounts = array_merge(...array_values($mounts));
return $this->filterMounts($user, $mounts);
}

@ -199,10 +199,7 @@ class SetupManager {
$this->eventLogger->start('fs:setup:user:full', 'Setup full filesystem for user');
if (!isset($this->setupUserMountProviders[$user->getUID()])) {
$this->setupUserMountProviders[$user->getUID()] = [];
}
$this->setupUserMountProviders[$user->getUID()] ??= [];
$previouslySetupProviders = $this->setupUserMountProviders[$user->getUID()];
$this->setupForUserWith($user, function () use ($user) {