psalm: remove more dead code

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-14 18:15:01 -07:00
parent f992d19932
commit 6a58a10c86
5 changed files with 19 additions and 6 deletions

View File

@ -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}");
}

View File

@ -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);

View File

@ -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
{

View File

@ -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"
>
<!--
Duplication is due to differences in language server and CLI
@ -36,6 +38,11 @@
<referencedClass name="Doctrine\DBAL\Platforms\AbstractPlatform" />
</errorLevel>
</UndefinedDocblockClass>
<PossiblyUnusedMethod>
<errorLevel type="suppress">
<file name="lib/Service/FileRobotMagick.php" />
</errorLevel>
</PossiblyUnusedMethod>
</issueHandlers>
<forbiddenFunctions>
<function name="var_dump" />

View File

@ -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"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<!-- The language server works slightly differently and has a different file -->
<projectFiles>
@ -35,6 +37,11 @@
<referencedClass name="Doctrine\DBAL\Platforms\AbstractPlatform" />
</errorLevel>
</UndefinedDocblockClass>
<PossiblyUnusedMethod>
<errorLevel type="suppress">
<file name="lib/Service/FileRobotMagick.php" />
</errorLevel>
</PossiblyUnusedMethod>
</issueHandlers>
<forbiddenFunctions>
<function name="var_dump" />