Skip to content

Commit

Permalink
fix: Fix navigation manager to be in line with server
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Sep 30, 2024
1 parent c601f87 commit 927e24d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/FilteredNavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,20 @@ public function setActiveEntry($appId): void {
public function setUnreadCounter(string $id, int $unreadCounter): void {
$this->navigationManager->setUnreadCounter($id, $unreadCounter);
}

public function get(string $id): ?array {
return $this->navigationManager->get($id);

Check failure on line 74 in lib/FilteredNavigationManager.php

View workflow job for this annotation

GitHub Actions / Nextcloud dev-master

UndefinedMethod

lib/FilteredNavigationManager.php:74:36: UndefinedMethod: Method OC\NavigationManager::get does not exist (see https://psalm.dev/022)
}

public function getDefaultEntryIdForUser(?IUser $user = null, bool $withFallbacks = true): string {
return $this->navigationManager->getDefaultEntryIdForUser($user, $withFallbacks);

Check failure on line 78 in lib/FilteredNavigationManager.php

View workflow job for this annotation

GitHub Actions / Nextcloud dev-master

UndefinedMethod

lib/FilteredNavigationManager.php:78:36: UndefinedMethod: Method OC\NavigationManager::getDefaultEntryIdForUser does not exist (see https://psalm.dev/022)
}

public function getDefaultEntryIds(bool $withFallbacks = true): array {
return $this->navigationManager->getDefaultEntryIds($withFallbacks);

Check failure on line 82 in lib/FilteredNavigationManager.php

View workflow job for this annotation

GitHub Actions / Nextcloud dev-master

UndefinedMethod

lib/FilteredNavigationManager.php:82:36: UndefinedMethod: Method OC\NavigationManager::getDefaultEntryIds does not exist (see https://psalm.dev/022)
}

public function setDefaultEntryIds(array $ids): void {

Check failure on line 85 in lib/FilteredNavigationManager.php

View workflow job for this annotation

GitHub Actions / Nextcloud dev-master

MethodSignatureMismatch

lib/FilteredNavigationManager.php:85:43: MethodSignatureMismatch: Argument 1 of OCA\Guests\FilteredNavigationManager::setDefaultEntryIds has wrong type 'array<array-key, mixed>', expecting 'array<array-key, string>' as defined by OCP\INavigationManager::setDefaultEntryIds (see https://psalm.dev/042)
$this->navigationManager->setDefaultEntryIds($ids);

Check failure on line 86 in lib/FilteredNavigationManager.php

View workflow job for this annotation

GitHub Actions / Nextcloud dev-master

UndefinedMethod

lib/FilteredNavigationManager.php:86:29: UndefinedMethod: Method OC\NavigationManager::setDefaultEntryIds does not exist (see https://psalm.dev/022)
}
}
2 changes: 1 addition & 1 deletion lib/RestrictionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function setupRestrictions(): void {
}

/** @var NavigationManager $navManager */
$navManager = $this->server->getNavigationManager();
$navManager = \OCP\Server::get(INavigationManager::class);

$this->server->registerService(INavigationManager::class, function () use ($navManager) {
return new FilteredNavigationManager($this->userSession->getUser(), $navManager, $this->whitelist);
Expand Down

0 comments on commit 927e24d

Please sign in to comment.