From c2d95ffaeaa289752b4c7b6664b6ca112a02e350 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 2 Nov 2023 19:08:58 +0100 Subject: Roundup of issues reported by PHPStorm Mostly redundant checks, logic errors, dead code, etc. --- modules-available/news/page.inc.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'modules-available/news') diff --git a/modules-available/news/page.inc.php b/modules-available/news/page.inc.php index a122d37c..bb74c711 100644 --- a/modules-available/news/page.inc.php +++ b/modules-available/news/page.inc.php @@ -201,8 +201,6 @@ class Page_News extends Page * * @param int $newsId ID of the news to be shown. * @param string $pageType type if news id is not given. - * - * @return bool true if loading that news worked */ private function loadNews($newsId, $pageType) { @@ -223,18 +221,15 @@ class Page_News extends Page ]); } if ($row === false) - return false; + return; // fetch the news to be shown - if ($row !== false) { - $this->newsId = $row['newsid']; - $this->newsTitle = $row['title']; - $this->newsContent = $row['content']; - $this->newsDateline = (int)$row['dateline']; - $this->newsExpires = (int)$row['expires']; - $this->pageType = $row['type']; - } - return true; + $this->newsId = $row['newsid']; + $this->newsTitle = $row['title']; + $this->newsContent = $row['content']; + $this->newsDateline = (int)$row['dateline']; + $this->newsExpires = (int)$row['expires']; + $this->pageType = $row['type']; } /** -- cgit v1.2.3-55-g7522