Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix(psalm): update baseline and suppress unnecessary issues
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Jan 9, 2024
commit 9e4c9b97ddf96b1a9379f5bdc5ecd1c24021291c
7 changes: 7 additions & 0 deletions apps/dav/appinfo/v2/publicremote.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,20 @@
$fileId = $share->getNodeId();

// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
/** @psalm-suppress InternalMethod */
$previousLog = Filesystem::logWarningWhenAddingStorageWrapper(false);

/** @psalm-suppress MissingClosureParamType */
Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
return new PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]);
});

/** @psalm-suppress MissingClosureParamType */
Filesystem::addStorageWrapper('shareOwner', function ($mountPoint, $storage) use ($share) {
return new PublicOwnerWrapper(['storage' => $storage, 'owner' => $share->getShareOwner()]);
});

/** @psalm-suppress InternalMethod */
Filesystem::logWarningWhenAddingStorageWrapper($previousLog);

OC_Util::tearDownFS();
Expand Down
6 changes: 0 additions & 6 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@
<code>$baseuri</code>
</UndefinedGlobalVariable>
</file>
<file src="apps/dav/appinfo/v2/publicremote.php">
<InternalMethod>
<code>Filesystem::logWarningWhenAddingStorageWrapper($previousLog)</code>
<code>Filesystem::logWarningWhenAddingStorageWrapper(false)</code>
</InternalMethod>
</file>
<file src="apps/dav/lib/AppInfo/Application.php">
<InvalidArgument>
<code>CalendarDeletionDefaultUpdaterListener::class</code>
Expand Down
4 changes: 2 additions & 2 deletions public.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @param $service
* @return string
*/
function resolveService($service) {
function resolveService(string $service): string {
$services = [
'webdav' => 'dav/appinfo/v1/publicwebdav.php',
'dav' => 'dav/appinfo/v2/publicremote.php',
Expand Down Expand Up @@ -74,7 +74,7 @@ function resolveService($service) {

$file = resolveService($service);

if (is_null($file)) {
if (!$file) {
throw new RemoteException('Path not found', 404);
}

Expand Down