Skip to content

Commit 9e4c9b9

Browse files
committed
fix(psalm): update baseline and suppress unnecessary issues
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent 18399fc commit 9e4c9b9

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

apps/dav/appinfo/v2/publicremote.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,20 @@
109109
$fileId = $share->getNodeId();
110110

111111
// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
112+
/** @psalm-suppress InternalMethod */
112113
$previousLog = Filesystem::logWarningWhenAddingStorageWrapper(false);
114+
115+
/** @psalm-suppress MissingClosureParamType */
113116
Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
114117
return new PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]);
115118
});
119+
120+
/** @psalm-suppress MissingClosureParamType */
116121
Filesystem::addStorageWrapper('shareOwner', function ($mountPoint, $storage) use ($share) {
117122
return new PublicOwnerWrapper(['storage' => $storage, 'owner' => $share->getShareOwner()]);
118123
});
124+
125+
/** @psalm-suppress InternalMethod */
119126
Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
120127

121128
OC_Util::tearDownFS();

build/psalm-baseline.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@
105105
<code>$baseuri</code>
106106
</UndefinedGlobalVariable>
107107
</file>
108-
<file src="apps/dav/appinfo/v2/publicremote.php">
109-
<InternalMethod>
110-
<code>Filesystem::logWarningWhenAddingStorageWrapper($previousLog)</code>
111-
<code>Filesystem::logWarningWhenAddingStorageWrapper(false)</code>
112-
</InternalMethod>
113-
</file>
114108
<file src="apps/dav/lib/AppInfo/Application.php">
115109
<InvalidArgument>
116110
<code>CalendarDeletionDefaultUpdaterListener::class</code>

public.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @param $service
3737
* @return string
3838
*/
39-
function resolveService($service) {
39+
function resolveService(string $service): string {
4040
$services = [
4141
'webdav' => 'dav/appinfo/v1/publicwebdav.php',
4242
'dav' => 'dav/appinfo/v2/publicremote.php',
@@ -74,7 +74,7 @@ function resolveService($service) {
7474

7575
$file = resolveService($service);
7676

77-
if (is_null($file)) {
77+
if (!$file) {
7878
throw new RemoteException('Path not found', 404);
7979
}
8080

0 commit comments

Comments
 (0)