Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/DAV/WorkspacePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use Exception;
use OC\Files\Node\File;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Files\FilesHome;
use OCA\Text\Service\ConfigService;
use OCA\Text\Service\WorkspaceService;
Expand Down Expand Up @@ -64,7 +63,7 @@ public function propFind(PropFind $propFind, INode $node) {
return;
}

if (!$node instanceof Directory && !$node instanceof FilesHome) {
if (!$node instanceof FilesHome) {
return;
}

Expand Down
12 changes: 4 additions & 8 deletions lib/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\StorageInvalidException;
use OCP\IL10N;

class WorkspaceService {
Expand All @@ -28,14 +25,13 @@
}

public function getFile(Folder $folder): ?File {
foreach ($this->getSupportedFilenames() as $filename) {
try {
$file = $folder->get($filename);
$content = $folder->getStorage()->getCache()->getFolderContents($folder->getInternalPath() . '/', 'text/markdown');

Check failure on line 28 in lib/Service/WorkspaceService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

TooManyArguments

lib/Service/WorkspaceService.php:28:49: TooManyArguments: Too many arguments for method OCP\Files\Cache\ICache::getfoldercontents - saw 2 (see https://psalm.dev/026)
foreach ($content as $file) {
if (in_array($file->getName(), $this->getSupportedFilenames(), true)) {
$file = $folder->get($file->getPath());
if ($file instanceof File) {
return $file;
}
} catch (NotFoundException|NotPermittedException|StorageInvalidException) {
continue;
}
}
return null;
Expand Down
Loading