diff options
| author | 2025-01-08 13:26:09 +0100 | |
|---|---|---|
| committer | 2025-01-08 13:26:09 +0100 | |
| commit | 50adb559823f935582f3ed308b8d4352c5f216ed (patch) | |
| tree | 74f09efadfcaf28f82505e791e267596f4026053 /app/Models/Feed.php | |
| parent | fa701b39f3775ac4250a82fabcec8970b446789b (diff) | |
Add some missing PHP native types (#7191)
* Add some missing PHP native types
Replaces https://github.com/FreshRSS/FreshRSS/pull/7184
* Clean some types
Diffstat (limited to 'app/Models/Feed.php')
| -rw-r--r-- | app/Models/Feed.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 645dbcf3c..dd508299d 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -287,8 +287,8 @@ class FreshRSS_Feed extends Minz_Model { $this->categoryId = $this->category == null ? 0 : $this->category->id(); } - /** @param int|string $id */ - public function _categoryId($id): void { + /** @param int|numeric-string $id */ + public function _categoryId(int|string $id): void { $this->category = null; $this->categoryId = (int)$id; } @@ -321,8 +321,8 @@ class FreshRSS_Feed extends Minz_Model { public function _httpAuth(string $value): void { $this->httpAuth = $value; } - /** @param bool|int $value */ - public function _error($value): void { + + public function _error(bool|int $value): void { $this->error = (bool)$value; } public function _mute(bool $value): void { @@ -350,7 +350,7 @@ class FreshRSS_Feed extends Minz_Model { /** * @throws Minz_FileNotExistException */ - if (CACHE_PATH == '') { + if (trim(CACHE_PATH) === '') { throw new Minz_FileNotExistException( 'CACHE_PATH', Minz_Exception::ERROR @@ -549,6 +549,9 @@ class FreshRSS_Feed extends Minz_Model { $authors = $item->get_authors(); $link = $item->get_permalink(); $date = $item->get_date('U'); + if (!is_numeric($date)) { + $date = 0; + } //Tag processing (tag == category) $categories = $item->get_categories(); |
