Skip to content

Commit

Permalink
fix: PSALM
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf authored Sep 11, 2024
1 parent 7923dfd commit d18571f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Folder/FolderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private function getFolderMappings(int $id): array {
private function getManageAcl(array $mappings): array {
return array_filter(array_map(function (array $entry): ?array {
if ($entry['mapping_type'] === 'user') {
$user = \OCP\Server::get(IUserManager::class)->get($entry['mapping_id']);
$user = Server::get(IUserManager::class)->get($entry['mapping_id']);
if ($user === null) {
return null;
}
Expand All @@ -240,14 +240,14 @@ private function getManageAcl(array $mappings): array {
'displayname' => (string)$user->getDisplayName()
];
}
$group = \OCP\Server::get(IGroupManager::class)->get($entry['mapping_id']);
$group = Server::get(IGroupManager::class)->get($entry['mapping_id']);
if ($group === null) {
return [];
}
return [
'type' => 'group',
'id' => (string)$group->getGID(),
'displayname' => (string)$group->getDisplayName()
'id' => $group->getGID(),
'displayname' => $group->getDisplayName()
];
}, $mappings), function (?array $element): bool {
return $element !== null;
Expand Down Expand Up @@ -304,7 +304,7 @@ public function getFolderAclEnabled(int $id): bool {

public function getFolderByPath(string $path): int {
/** @var Node $node */
$node = \OCP\Server::get(IRootFolder::class)->get($path);
$node = Server::get(IRootFolder::class)->get($path);
/** @var GroupMountPoint $mountPoint */
$mountPoint = $node->getMountPoint();
return $mountPoint->getFolderId();
Expand Down Expand Up @@ -412,7 +412,7 @@ public function canManageACL(int $folderId, IUser $user): bool {

// Call private server api
if (class_exists('\OC\Settings\AuthorizedGroupMapper')) {
$authorizedGroupMapper = \OCP\Server::get('\OC\Settings\AuthorizedGroupMapper');
$authorizedGroupMapper = Server::get('\OC\Settings\AuthorizedGroupMapper');
$settingClasses = $authorizedGroupMapper->findAllClassesForUser($user);
if (in_array('OCA\GroupFolders\Settings\Admin', $settingClasses, true)) {
return true;
Expand Down

0 comments on commit d18571f

Please sign in to comment.