1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Enhancement: Use constructor property promotion (#858)

This commit is contained in:
Andreas Möller
2023-12-06 14:54:37 +01:00
committed by GitHub
parent 1d7287778c
commit 878429e644

View File

@@ -8,47 +8,15 @@ namespace phpweb\UserNotes;
*/
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;
}
}