diff options
| author | 2023-11-16 22:43:00 +0100 | |
|---|---|---|
| committer | 2023-11-16 22:43:00 +0100 | |
| commit | 30c7a61a9b410f023c56ef19b9389a61647d8768 (patch) | |
| tree | bb58408980ce5b86f1d2b4a9be29d55b2d46dbb1 /app/Models/Entry.php | |
| parent | ee99e7e2cc228500efc1b539954c0ca6cd4c146d (diff) | |
Use strict_types (#5830)
* Little's optimisations and booleans in conditions
* Apply strict type
* Apply strict type
* Apply strict type
* Fix multiple bugs with PHP 8.2 and 8.3
* Many declares missing, more errors fixed
* Apply strict type
* Another approach
* Stronger typing for Minz_Session
* Fix case of SQLite
---------
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/Entry.php')
| -rw-r--r-- | app/Models/Entry.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 249f607ee..e19a637d7 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); class FreshRSS_Entry extends Minz_Model { public const STATE_READ = 1; @@ -437,7 +438,11 @@ HTML; return $this->hash; } - public function _id(string $value): void { + /** @param int|string $value String is for compatibility with 32-bit platforms */ + public function _id($value): void { + if (is_int($value)) { + $value = (string)$value; + } $this->id = $value; if ($this->date_added == 0) { $this->date_added = $value; @@ -741,11 +746,11 @@ HTML; } $content = ''; - $nodes = $xpath->query(new Gt\CssXPath\Translator($path)); + $nodes = $xpath->query((new Gt\CssXPath\Translator($path))->asXPath()); if ($nodes != false) { foreach ($nodes as $node) { if (!empty($attributes['path_entries_filter'])) { - $filterednodes = $xpath->query(new Gt\CssXPath\Translator($attributes['path_entries_filter']), $node) ?: []; + $filterednodes = $xpath->query((new Gt\CssXPath\Translator($attributes['path_entries_filter']))->asXPath(), $node) ?: []; foreach ($filterednodes as $filterednode) { $filterednode->parentNode->removeChild($filterednode); } |
