From bfeeffd03a90f171d8cc9879dcda696fd3d175d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Rie=C3=9F?= Date: Thu, 21 May 2026 11:37:07 +0200 Subject: [PATCH] Use Null coalescing operator instead of default value of `getPopulatedValue` Populated values gets populated with a null value if there is no user preference set. the default parameter is only used if the value isn't populated at all. A null value still counts as populated and is therefore returned by `getPopulatedValue`. Calling `array_key_exists` with a null key is deprecated in php 8.5 --- library/Feeds/Web/FeedViewModeSwitcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Feeds/Web/FeedViewModeSwitcher.php b/library/Feeds/Web/FeedViewModeSwitcher.php index f47a3e5..4fc7f62 100644 --- a/library/Feeds/Web/FeedViewModeSwitcher.php +++ b/library/Feeds/Web/FeedViewModeSwitcher.php @@ -99,7 +99,7 @@ public function setViewModeParam(string $viewModeParam): self */ public function getViewMode(): string { - $viewMode = $this->getPopulatedValue($this->getViewModeParam(), $this->getDefaultViewMode()); + $viewMode = $this->getPopulatedValue($this->getViewModeParam()) ?? $this->getDefaultViewMode(); if (array_key_exists($viewMode, static::$viewModes)) { return $viewMode;