From 7996a12aef25b7ac8bd9a61f7b09f6806cef5ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 5 Dec 2022 16:40:46 +0100 Subject: [PATCH] Silence false-positive from psalm in lib/public/Log/functions.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- build/psalm-baseline.xml | 6 ------ lib/public/Log/functions.php | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index e77d3cbee80..b4162099598 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1789,12 +1789,6 @@ getAppsNeedingUpgrade getIncompatibleApps - - $restrictions - - - ((array)$request->getParam('appid')) !== '' - diff --git a/lib/public/Log/functions.php b/lib/public/Log/functions.php index cc6961d8fba..ac043b4d958 100644 --- a/lib/public/Log/functions.php +++ b/lib/public/Log/functions.php @@ -49,6 +49,7 @@ use function class_exists; * @since 24.0.0 */ function logger(string $appId = null): LoggerInterface { + /** @psalm-suppress TypeDoesNotContainNull false-positive, it may contain null if we are logging from initialization */ if (!class_exists(OC::class) || OC::$server === null) { // If someone calls this log before Nextcloud is initialized, there is // no logging available. In that case we return a noop implementation