Skip to content

Commit ea28113

Browse files
committed
use promoted properties
1 parent 8914bae commit ea28113

3 files changed

Lines changed: 7 additions & 18 deletions

File tree

src/Session.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,14 @@
1818
*/
1919
final class Session
2020
{
21-
private Id $id;
22-
private Name $name;
23-
/** @var Map<string, mixed> */
24-
private Map $values;
25-
2621
/**
2722
* @param Map<string, mixed> $values
2823
*/
29-
private function __construct(Id $id, Name $name, Map $values)
30-
{
31-
$this->id = $id;
32-
$this->name = $name;
33-
$this->values = $values;
24+
private function __construct(
25+
private Id $id,
26+
private Name $name,
27+
private Map $values,
28+
) {
3429
}
3530

3631
/**

src/Session/Id.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
*/
1414
final class Id
1515
{
16-
private string $value;
17-
18-
private function __construct(string $value)
16+
private function __construct(private string $value)
1917
{
20-
$this->value = $value;
2118
}
2219

2320
/**

src/Session/Name.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
*/
1515
final class Name
1616
{
17-
private string $value;
18-
19-
private function __construct(string $value)
17+
private function __construct(private string $value)
2018
{
21-
$this->value = $value;
2219
}
2320

2421
/**

0 commit comments

Comments
 (0)