diff options
| author | 2024-06-05 22:04:06 +0200 | |
|---|---|---|
| committer | 2024-06-05 22:04:06 +0200 | |
| commit | f99c8d5f54c67e0abc3f3189b4f5e3e4571e114c (patch) | |
| tree | d7d74a628cd9614dd4093220139b6c073f3a5c54 /app/Models/Entry.php | |
| parent | 8fc8ac3aefca73a4cd509313a2f1ad73ef7f2e1a (diff) | |
Modernize code to php7.4 (#6043)
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Modernize code to php7.4
* Consistency
---------
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 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 956134c78..2325252f7 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -244,12 +244,12 @@ HTML; $content .= '<p class="enclosure-content"><img src="' . $elink . '" alt="" title="' . $etitle . '" /></p>'; } elseif ($medium === 'audio' || strpos($mime, 'audio') === 0) { $content .= '<p class="enclosure-content"><audio preload="none" src="' . $elink - . ($length == null ? '' : '" data-length="' . intval($length)) + . ($length == null ? '' : '" data-length="' . (int)$length) . ($mime == '' ? '' : '" data-type="' . htmlspecialchars($mime, ENT_COMPAT, 'UTF-8')) . '" controls="controls" title="' . $etitle . '"></audio> <a download="" href="' . $elink . '">💾</a></p>'; } elseif ($medium === 'video' || strpos($mime, 'video') === 0) { $content .= '<p class="enclosure-content"><video preload="none" src="' . $elink - . ($length == null ? '' : '" data-length="' . intval($length)) + . ($length == null ? '' : '" data-length="' . (int)$length) . ($mime == '' ? '' : '" data-type="' . htmlspecialchars($mime, ENT_COMPAT, 'UTF-8')) . '" controls="controls" title="' . $etitle . '"></video> <a download="" href="' . $elink . '">💾</a></p>'; } else { //e.g. application, text, unknown @@ -401,10 +401,10 @@ HTML; if ($microsecond) { return $this->date_added; } else { - return intval(substr($this->date_added, 0, -6)); + return (int)substr($this->date_added, 0, -6); } } else { - $date = intval(substr($this->date_added, 0, -6)); + $date = (int)substr($this->date_added, 0, -6); return timestamptodate($date); } } @@ -519,7 +519,7 @@ HTML; } /** @param int|string $value */ public function _date($value): void { - $value = intval($value); + $value = (int)$value; $this->date = $value > 1 ? $value : time(); } @@ -552,7 +552,7 @@ HTML; /** @param int|string $id */ private function _feedId($id): void { $this->feed = null; - $this->feedId = intval($id); + $this->feedId = (int)$id; } /** @param array<string>|string $value */ @@ -966,7 +966,7 @@ HTML; (self::enclosureIsImage($enclosure) ? 'image' : ''), ]; if (!empty($enclosure['length'])) { - $media['length'] = intval($enclosure['length']); + $media['length'] = (int)$enclosure['length']; } $item['enclosure'][] = $media; } |
