Skip to content

Commit

Permalink
add notes path to capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Jan 24, 2025
1 parent 7602429 commit b79788e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/AppInfo/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@

namespace OCA\Notes\AppInfo;

use OCA\Notes\Service\NoteUtil;
use OCP\App\IAppManager;
use OCP\Capabilities\ICapability;
use OCP\IUserSession;

class Capabilities implements ICapability {
private IAppManager $appManager;

public function __construct(IAppManager $appManager) {
$this->appManager = $appManager;
public function __construct(private IAppManager $appManager,
private NoteUtil $noteUtil,
private IUserSession $userSession) {
}

public function getCapabilities(): array {
return [
Application::APP_ID => [
'api_version' => Application::$API_VERSIONS,
'version' => $this->appManager->getAppVersion(Application::APP_ID),
'notes_path' => $this->noteUtil->getOrCreateNotesFolder($this->userSession->getUser()->getUID())->getInternalPath()

Check failure on line 28 in lib/AppInfo/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

PossiblyNullReference

lib/AppInfo/Capabilities.php:28:92: PossiblyNullReference: Cannot call method getUID on possibly null value (see https://psalm.dev/083)

Check failure on line 28 in lib/AppInfo/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable29

PossiblyNullReference

lib/AppInfo/Capabilities.php:28:92: PossiblyNullReference: Cannot call method getUID on possibly null value (see https://psalm.dev/083)

Check failure on line 28 in lib/AppInfo/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

PossiblyNullReference

lib/AppInfo/Capabilities.php:28:92: PossiblyNullReference: Cannot call method getUID on possibly null value (see https://psalm.dev/083)

Check failure on line 28 in lib/AppInfo/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable31

PossiblyNullReference

lib/AppInfo/Capabilities.php:28:92: PossiblyNullReference: Cannot call method getUID on possibly null value (see https://psalm.dev/083)
],
];
}
Expand Down

0 comments on commit b79788e

Please sign in to comment.