diff options
| author | 2023-10-30 20:47:27 +0100 | |
|---|---|---|
| committer | 2023-10-30 20:47:27 +0100 | |
| commit | 06d00995049db9c7b915f67cfd4a5708aace458f (patch) | |
| tree | 0176ca9761b34d72ffd597bd96da3c3ae4912d86 /app/Models/View.php | |
| parent | 4a02352ccc1b313ce967415c6ac10a32aba1893a (diff) | |
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
Diffstat (limited to 'app/Models/View.php')
| -rw-r--r-- | app/Models/View.php | 175 |
1 files changed, 65 insertions, 110 deletions
diff --git a/app/Models/View.php b/app/Models/View.php index f1bc55707..b8d776fbc 100644 --- a/app/Models/View.php +++ b/app/Models/View.php @@ -10,166 +10,121 @@ class FreshRSS_View extends Minz_View { /** @var callable */ public $callbackBeforePagination; /** @var array<FreshRSS_Category> */ - public $categories; - /** @var FreshRSS_Category|null */ - public $category; - /** @var string */ - public $current_user; + public array $categories; + public ?FreshRSS_Category $category; + public string $current_user; /** @var iterable<FreshRSS_Entry> */ public $entries; - /** @var FreshRSS_Entry */ - public $entry; - /** @var FreshRSS_Feed|null */ - public $feed; + public FreshRSS_Entry $entry; + public ?FreshRSS_Feed $feed; /** @var array<FreshRSS_Feed> */ - public $feeds; - /** @var int */ - public $nbUnreadTags; + public array $feeds; + public int $nbUnreadTags; /** @var array<FreshRSS_Tag> */ - public $tags; + public array $tags; /** @var array<int,array{'id':int,'name':string,'id_entry':string,'checked':bool}> */ - public $tagsForEntry; + public array $tagsForEntry; /** @var array<string,array<string>> */ - public $tagsForEntries; + public array $tagsForEntries; /** @var array<string,string> */ - public $notification; - /** @var bool */ - public $excludeMutedFeeds; + public array $notification; + public bool $excludeMutedFeeds; // Substriptions - /** @var FreshRSS_Category|null */ - public $default_category; - /** @var bool */ - public $displaySlider; - /** @var bool */ - public $load_ok; - /** @var bool */ - public $onlyFeedsWithError; - /** @var bool */ - public $signalError; + public ?FreshRSS_Category $default_category; + public bool $displaySlider = false; + public bool $load_ok; + public bool $onlyFeedsWithError; + public bool $signalError; // Manage users /** @var array{'feed_count':int,'article_count':int,'database_size':int,'language':string,'mail_login':string,'enabled':bool,'is_admin':bool,'last_user_activity':string,'is_default':bool} */ - public $details; - /** @var bool */ - public $disable_aside; - /** @var bool */ - public $show_email_field; - /** @var string */ - public $username; + public array $details; + public bool $disable_aside; + public bool $show_email_field; + public string $username; /** @var array<array{'language':string,'enabled':bool,'is_admin':bool,'enabled':bool,'article_count':int,'database_size':int,'last_user_activity':string,'mail_login':string,'feed_count':int,'is_default':bool}> */ - public $users; + public array $users; // Updates - /** @var string */ - public $last_update_time; + public string $last_update_time; /** @var array<string,bool> */ - public $status_files; + public array $status_files; /** @var array<string,bool> */ - public $status_php; - /** @var bool */ - public $update_to_apply; + public array $status_php; + public bool $update_to_apply; /** @var array<string,bool> */ - public $status_database; - /** @var bool */ - public $is_release_channel_stable; + public array $status_database; + public bool $is_release_channel_stable; // Archiving - /** @var int */ - public $nb_total; - /** @var int */ - public $size_total; - /** @var int */ - public $size_user; + public int $nb_total; + public int $size_total; + public int $size_user; // Display /** @var array<string,array{'id':string,'name':string,'author':string,'description':string,'version':float|string,'files':array<string>,'theme-color'?:string|array{'dark'?:string,'light'?:string,'default'?:string}}> */ - public $themes; + public array $themes; // Shortcuts /** @var array<int, string> */ - public $list_keys; + public array $list_keys; // User queries /** @var array<int,FreshRSS_UserQuery> */ - public $queries; + public array $queries; /** @var FreshRSS_UserQuery|null */ - public $query; + public ?FreshRSS_UserQuery $query = null; // Export / Import - /** @var string */ - public $content; + public string $content; /** @var array<string,array<string>> */ - public $entryIdsTagNames; - /** @var string */ - public $list_title; - /** @var int */ - public $queryId; - /** @var string */ - public $type; + public array $entryIdsTagNames; + public string $list_title; + public int $queryId; + public string $type; // Form login - /** @var int */ - public $cookie_days; + public int $cookie_days; // Registration - /** @var bool */ - public $can_register; - /** @var string */ - public $preferred_language; - /** @var bool */ - public $show_tos_checkbox; - /** @var string */ - public $terms_of_service; - /** @var string */ - public $site_title; - /** @var string */ - public $validation_url; + public bool $can_register; + public string $preferred_language; + public bool $show_tos_checkbox; + public string $terms_of_service; + public string $site_title; + public string $validation_url; // Logs - /** @var int */ - public $currentPage; - /** @var Minz_Paginator */ - public $logsPaginator; - /** @var int */ - public $nbPage; + public int $currentPage; + public Minz_Paginator $logsPaginator; + public int $nbPage; // RSS view - /** @var string */ - public $rss_title = ''; - /** @var string */ - public $rss_url = ''; - /** @var string */ - public $rss_base = ''; - /** @var bool */ - public $internal_rendering = false; + public string $rss_title = ''; + public string $rss_url = ''; + public string $rss_base = ''; + public bool $internal_rendering = false; // Content preview - /** @var string */ - public $fatalError; - /** @var string */ - public $htmlContent; - /** @var bool */ - public $selectorSuccess; + public string $fatalError; + public string $htmlContent; + public bool $selectorSuccess; // Extensions /** @var array<string,array{'name':string,'author':string,'description':string,'version':string,'entrypoint':string,'type':'system'|'user','url':string,'method':string,'directory':string}> */ - public $available_extensions; - /** @var ?Minz_Extension */ - public $ext_details; + public array $available_extensions; + public ?Minz_Extension $ext_details; /** @var array{'system':array<Minz_Extension>,'user':array<Minz_Extension>} */ - public $extension_list; - /** @var ?Minz_Extension */ - public $extension; + public array $extension_list; + public ?Minz_Extension $extension; /** @var array<string,string> */ - public $extensions_installed; + public array $extensions_installed; // Errors - /** @var string */ - public $code; - /** @var string */ - public $errorMessage; + public string $code; + public string $errorMessage; /** @var array<string,string> */ - public $message; + public array $message; } |
