From 926ffd2c5d76110a86acffeb64ede86644963dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 6 Dec 2023 14:34:12 +0100 Subject: [PATCH] Enhancement: Use constructor property promotion --- src/UserNotes/UserNote.php | 48 +++++++------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/src/UserNotes/UserNote.php b/src/UserNotes/UserNote.php index 54987e0d0f..f90fac9b09 100644 --- a/src/UserNotes/UserNote.php +++ b/src/UserNotes/UserNote.php @@ -8,47 +8,15 @@ */ final class UserNote { - /** @var string $id */ - public $id; - - /** @var string $sect */ - public $sect; - - /** @var string $rate */ - public $rate; - - /** @var string $ts */ - public $ts; - - /** @var string $user */ - public $user; - - /** @var string $text */ - public $text; - - /** @var int $upvotes */ - public $upvotes; - - /** @var int $downvotes */ - public $downvotes; - public function __construct( - string $id, - string $sect, - string $rate, - string $ts, - string $user, - string $text, - int $upvotes = 0, - int $downvotes = 0 + public string $id, + public string $sect, + public string $rate, + public string $ts, + public string $user, + public string $text, + public int $upvotes = 0, + public int $downvotes = 0 ) { - $this->id = $id; - $this->sect = $sect; - $this->rate = $rate; - $this->ts = $ts; - $this->user = $user; - $this->text = $text; - $this->upvotes = $upvotes; - $this->downvotes = $downvotes; } }