aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-07-07 22:36:27 +0200
committerGravatar GitHub <noreply@github.com> 2023-07-07 22:36:27 +0200
commitf8f163d054110f7e0ff6650fca146b474335f4bd (patch)
treedbd831e600bc76ca2830cd417bd52b712ff97309 /app/Models/Entry.php
parent7f9594b8c7d7799f2e5f89328bd5981410db8cf0 (diff)
Chore/processing of depreciations and updating code to php72 minimum (#5504)
* processing of depreciations and updating of code to php7.2 minimum * Autoformat many strange array indenting And revert a few unwanted changes --------- 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.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 86b3899d8..7e10367fa 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -1,11 +1,11 @@
<?php
class FreshRSS_Entry extends Minz_Model {
- const STATE_READ = 1;
- const STATE_NOT_READ = 2;
- const STATE_ALL = 3;
- const STATE_FAVORITE = 4;
- const STATE_NOT_FAVORITE = 8;
+ public const STATE_READ = 1;
+ public const STATE_NOT_READ = 2;
+ public const STATE_ALL = 3;
+ public const STATE_FAVORITE = 4;
+ public const STATE_NOT_FAVORITE = 8;
/** @var string */
private $id = '0';
@@ -143,7 +143,7 @@ class FreshRSS_Entry extends Minz_Model {
$medium = $enclosure['medium'] ?? '';
$mime = $enclosure['type'] ?? '';
- return $elink != '' && $medium === 'image' || strpos($mime, 'image') === 0 ||
+ return ($elink != '' && $medium === 'image') || strpos($mime, 'image') === 0 ||
($mime == '' && $length == 0 && preg_match('/[.](avif|gif|jpe?g|png|svg|webp)$/i', $elink));
}
@@ -800,7 +800,7 @@ HTML;
* 'hash':string,'is_read':?bool,'is_favorite':?bool,'id_feed':int,'tags':string,'attributes':array<string,mixed>}
*/
public function toArray(): array {
- return array(
+ return [
'id' => $this->id(),
'guid' => $this->guid(),
'title' => $this->title(),
@@ -815,7 +815,7 @@ HTML;
'id_feed' => $this->feedId(),
'tags' => $this->tags(true),
'attributes' => $this->attributes(),
- );
+ ];
}
/**
@@ -833,7 +833,7 @@ HTML;
* Some clients (tested with News+) would fail if sending too long item content
* @var int
*/
- const API_MAX_COMPAT_CONTENT_LENGTH = 500000;
+ public const API_MAX_COMPAT_CONTENT_LENGTH = 500000;
/**
* N.B.: To avoid expensive lookups, ensure to set `$entry->_feed($feed)` before calling this function.