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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user