From bd9fa803f1f0c23face77fa1bc550d1198ce5ad6 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 2 May 2023 14:38:32 +0200 Subject: PHPStan Level 7 complete DAOs (#5354) * PHPStan Level 7 complete DAOs * Finalise PHPStan Level 7 for CategoryDAO * PHPStan Level 7 for Context and Search * Apply suggestions from code review Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> --- app/Models/Search.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'app/Models/Search.php') diff --git a/app/Models/Search.php b/app/Models/Search.php index f5b061512..d165b05f0 100644 --- a/app/Models/Search.php +++ b/app/Models/Search.php @@ -164,37 +164,37 @@ class FreshRSS_Search { } public function getMinDate(): ?int { - return $this->min_date; + return $this->min_date ?: null; } public function getNotMinDate(): ?int { - return $this->not_min_date; + return $this->not_min_date ?: null; } public function setMinDate(int $value): void { $this->min_date = $value; } public function getMaxDate(): ?int { - return $this->max_date; + return $this->max_date ?: null; } public function getNotMaxDate(): ?int { - return $this->not_max_date; + return $this->not_max_date ?: null; } public function setMaxDate(int $value): void { $this->max_date = $value; } public function getMinPubdate(): ?int { - return $this->min_pubdate; + return $this->min_pubdate ?: null; } public function getNotMinPubdate(): ?int { - return $this->not_min_pubdate; + return $this->not_min_pubdate ?: null; } public function getMaxPubdate(): ?int { - return $this->max_pubdate; + return $this->max_pubdate ?: null; } public function getNotMaxPubdate(): ?int { - return $this->not_max_pubdate; + return $this->not_max_pubdate ?: null; } /** @return array|null */ @@ -518,7 +518,7 @@ class FreshRSS_Search { $input = str_replace($matches[0], '', $input); $dates = self::removeEmptyValues($matches['search']); if (!empty($dates[0])) { - list($this->min_date, $this->max_date) = parseDateInterval($dates[0]); + [$this->min_date, $this->max_date] = parseDateInterval($dates[0]); } } return $input; @@ -529,7 +529,7 @@ class FreshRSS_Search { $input = str_replace($matches[0], '', $input); $dates = self::removeEmptyValues($matches['search']); if (!empty($dates[0])) { - list($this->not_min_date, $this->not_max_date) = parseDateInterval($dates[0]); + [$this->not_min_date, $this->not_max_date] = parseDateInterval($dates[0]); } } return $input; @@ -545,7 +545,7 @@ class FreshRSS_Search { $input = str_replace($matches[0], '', $input); $dates = self::removeEmptyValues($matches['search']); if (!empty($dates[0])) { - list($this->min_pubdate, $this->max_pubdate) = parseDateInterval($dates[0]); + [$this->min_pubdate, $this->max_pubdate] = parseDateInterval($dates[0]); } } return $input; @@ -556,7 +556,7 @@ class FreshRSS_Search { $input = str_replace($matches[0], '', $input); $dates = self::removeEmptyValues($matches['search']); if (!empty($dates[0])) { - list($this->not_min_pubdate, $this->not_max_pubdate) = parseDateInterval($dates[0]); + [$this->not_min_pubdate, $this->not_max_pubdate] = parseDateInterval($dates[0]); } } return $input; -- cgit v1.2.3