]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(psalm): update baseline and suppress unnecessary issues 32400/head
authorJohn Molakvoæ <skjnldsv@protonmail.com>
Fri, 29 Dec 2023 09:16:08 +0000 (10:16 +0100)
committerJohn Molakvoæ <skjnldsv@protonmail.com>
Tue, 9 Jan 2024 10:08:46 +0000 (11:08 +0100)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
apps/dav/appinfo/v2/publicremote.php
build/psalm-baseline.xml
public.php

index f9a3b23e0b82133f4d23eea8e4858ffd80519ea6..0ef9bda8ddabca61f048c462c29ff610d5079ccf 100644 (file)
@@ -109,13 +109,20 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
        $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();
index 4af64e0bcab8b74893ee98e19b80de7d7d34b80c..ba529091482996802d09144026f7ee5ce8bda0cb 100644 (file)
       <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>
index 5954da7e3a01fe5f518353b33fd7a5ab2db2bbb4..9f3ffcec5e9195426d560b170901b1dbeea386e9 100644 (file)
@@ -36,7 +36,7 @@ require_once __DIR__ . '/lib/versioncheck.php';
  * @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',
@@ -74,7 +74,7 @@ try {
 
        $file = resolveService($service);
 
-       if (is_null($file)) {
+       if (!$file) {
                throw new RemoteException('Path not found', 404);
        }