Skip to content

Commit 878429e

Browse files
authored
Enhancement: Use constructor property promotion (#858)
1 parent 1d72877 commit 878429e

File tree

1 file changed

+8
-40
lines changed

1 file changed

+8
-40
lines changed

src/UserNotes/UserNote.php

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,15 @@
88
*/
99
final class UserNote
1010
{
11-
/** @var string $id */
12-
public $id;
13-
14-
/** @var string $sect */
15-
public $sect;
16-
17-
/** @var string $rate */
18-
public $rate;
19-
20-
/** @var string $ts */
21-
public $ts;
22-
23-
/** @var string $user */
24-
public $user;
25-
26-
/** @var string $text */
27-
public $text;
28-
29-
/** @var int $upvotes */
30-
public $upvotes;
31-
32-
/** @var int $downvotes */
33-
public $downvotes;
34-
3511
public function __construct(
36-
string $id,
37-
string $sect,
38-
string $rate,
39-
string $ts,
40-
string $user,
41-
string $text,
42-
int $upvotes = 0,
43-
int $downvotes = 0
12+
public string $id,
13+
public string $sect,
14+
public string $rate,
15+
public string $ts,
16+
public string $user,
17+
public string $text,
18+
public int $upvotes = 0,
19+
public int $downvotes = 0
4420
) {
45-
$this->id = $id;
46-
$this->sect = $sect;
47-
$this->rate = $rate;
48-
$this->ts = $ts;
49-
$this->user = $user;
50-
$this->text = $text;
51-
$this->upvotes = $upvotes;
52-
$this->downvotes = $downvotes;
5321
}
5422
}

0 commit comments

Comments
 (0)