From 06d00995049db9c7b915f67cfd4a5708aace458f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 30 Oct 2023 20:47:27 +0100 Subject: Require PHP 7.4+ (#5720) * Require PHP 7.4+ https://github.com/FreshRSS/FreshRSS/discussions/5474 * Update Docker oldest Alpine 3.13 with PHP 7.4.26 * Add missing packets to Docker oldest * Update to typed properties https://php.net/migration74.new-features#migration74.new-features.core.typed-properties * More types --- app/Models/ViewStats.php | 53 +++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'app/Models/ViewStats.php') diff --git a/app/Models/ViewStats.php b/app/Models/ViewStats.php index 9025a86db..f07c19c91 100644 --- a/app/Models/ViewStats.php +++ b/app/Models/ViewStats.php @@ -4,54 +4,47 @@ declare(strict_types=1); final class FreshRSS_ViewStats extends FreshRSS_View { - /** @var FreshRSS_Category|null */ - public $default_category; + public ?FreshRSS_Category $default_category; /** @var array */ - public $categories; - /** @var FreshRSS_Feed|null */ - public $feed; + public array $categories; + public ?FreshRSS_Feed $feed; /** @var array */ - public $feeds; - /** @var bool */ - public $displaySlider; + public array $feeds; + public bool $displaySlider = false; - /** @var float */ - public $average; - /** @var float */ - public $averageDayOfWeek; - /** @var float */ - public $averageHour; - /** @var float */ - public $averageMonth; + public float $average; + public float $averageDayOfWeek; + public float $averageHour; + public float $averageMonth; /** @var array */ - public $days; + public array $days; /** @var array> */ - public $entryByCategory; + public array $entryByCategory; /** @var array */ - public $entryCount; + public array $entryCount; /** @var array> */ - public $feedByCategory; + public array $feedByCategory; /** @var array */ - public $hours24Labels; + public array $hours24Labels; /** @var array>> */ - public $idleFeeds; + public array $idleFeeds; /** @var array */ - public $last30DaysLabel; + public array $last30DaysLabel; /** @var array */ - public $last30DaysLabels; + public array $last30DaysLabels; /** @var array */ - public $months; + public array $months; /** @var array{'total':int,'count_unreads':int,'count_reads':int,'count_favorites':int}|false */ public $repartition; /** @var array{'main_stream':array{'total':int,'count_unreads':int,'count_reads':int,'count_favorites':int}|false,'all_feeds':array{'total':int,'count_unreads':int,'count_reads':int,'count_favorites':int}|false} */ - public $repartitions; + public array $repartitions; /** @var array */ - public $repartitionDayOfWeek; + public array $repartitionDayOfWeek; /** @var array|array */ - public $repartitionHour; + public array $repartitionHour; /** @var array */ - public $repartitionMonth; + public array $repartitionMonth; /** @var array */ - public $topFeed; + public array $topFeed; } -- cgit v1.2.3