diff --git a/lib/Controller/ArchiveController.php b/lib/Controller/ArchiveController.php index c3431b7f..a82cc640 100644 --- a/lib/Controller/ArchiveController.php +++ b/lib/Controller/ArchiveController.php @@ -57,15 +57,12 @@ class ArchiveController extends GenericApiController // Create archive folder in the root of the user's configured timeline $configPaths = Util::getTimelinePaths(Util::getUID()); - $timelineFolders = []; $timelinePaths = []; // Get all timeline paths foreach ($configPaths as $path) { try { - $f = $userFolder->get($path); - $timelineFolders[] = $f; - $timelinePaths[] = $f->getPath(); + $timelinePaths[] = $userFolder->get($path)->getPath(); } catch (\OCP\Files\NotFoundException $e) { throw Exceptions::NotFound("timeline folder {$path}"); } diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index 60292c28..18f3eb1d 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -70,10 +70,8 @@ class ShareController extends GenericApiController return Util::guardEx(function () use ($id, $path) { $file = $this->getNodeByIdOrPath($id, $path); - /** @var \OCP\Share\IManager $shareManager */ $shareManager = \OC::$server->get(\OCP\Share\IManager::class); - /** @var \OCP\Share\IShare $share */ $share = $shareManager->newShare(); $share->setNode($file); $share->setShareType(\OCP\Share\IShare::TYPE_LINK); diff --git a/lib/Util.php b/lib/Util.php index 17314762..f81e6b49 100644 --- a/lib/Util.php +++ b/lib/Util.php @@ -170,6 +170,10 @@ class Util /** * Check if link sharing is allowed. + * + * @todo Check if link sharing is enabled to show the button + * + * @psalm-suppress PossiblyUnusedMethod */ public static function isLinkSharingEnabled(): bool { diff --git a/psalm-ls.xml b/psalm-ls.xml index 43ee8843..83b277b3 100644 --- a/psalm-ls.xml +++ b/psalm-ls.xml @@ -7,6 +7,8 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" cacheDirectory=".cache/psalm-ls" + findUnusedBaselineEntry="true" + findUnusedCode="false" > @@ -35,6 +37,11 @@ + + + + +