diff options
| author | 2023-05-02 14:38:32 +0200 | |
|---|---|---|
| committer | 2023-05-02 14:38:32 +0200 | |
| commit | bd9fa803f1f0c23face77fa1bc550d1198ce5ad6 (patch) | |
| tree | edba662e84e70a6b0f23c8379d4ef174f714e999 /app/Models/Search.php | |
| parent | 4de1d5efea128e6cc70c71bad9be28d01e851f81 (diff) | |
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>
Diffstat (limited to 'app/Models/Search.php')
| -rw-r--r-- | app/Models/Search.php | 24 |
1 files changed, 12 insertions, 12 deletions
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<string>|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; |
