From 15745d42b779ad14efde2932ab116f45eee39246 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:11:04 +0100 Subject: Upgrade code to php 8.1 (#6748) * revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez Co-authored-by: Alexandre Alapetite --- app/Models/UserQuery.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'app/Models/UserQuery.php') diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php index 1ec8ee148..d3a56bb6a 100644 --- a/app/Models/UserQuery.php +++ b/app/Models/UserQuery.php @@ -8,7 +8,6 @@ declare(strict_types=1); * easy way. */ class FreshRSS_UserQuery { - private bool $deprecated = false; private string $get = ''; private string $get_name = ''; @@ -16,16 +15,12 @@ class FreshRSS_UserQuery { /** XML-encoded name */ private string $name = ''; private string $order = ''; - private FreshRSS_BooleanSearch $search; + private readonly FreshRSS_BooleanSearch $search; private int $state = 0; private string $url = ''; private string $token = ''; private bool $shareRss = false; private bool $shareOpml = false; - /** @var array $categories */ - private array $categories; - /** @var array $labels */ - private array $labels; /** XML-encoded description */ private string $description = ''; private string $imageUrl = ''; @@ -48,9 +43,11 @@ class FreshRSS_UserQuery { * @param array $categories * @param array $labels */ - public function __construct(array $query, array $categories, array $labels) { - $this->categories = $categories; - $this->labels = $labels; + public function __construct( + array $query, + private array $categories, + private array $labels, + ) { if (isset($query['get'])) { $this->parseGet($query['get']); } else { -- cgit v1.2.3