Skip to content

Commit 376a260

Browse files
committed
Refactor UUID listeners
1 parent 259a8ba commit 376a260

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Listener/Uuid2.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ final class Uuid2 extends BaseUuid
2222
private static int|string|null $defaultNode = null;
2323

2424
private static ?int $defaultClockSeq = null;
25-
private UuidV2Factory $factory;
25+
private readonly UuidV2Factory $factory;
26+
private readonly ?DceDomain $localDomain;
2627

2728
/**
2829
* @param non-empty-string $field The name of the field to store the UUID
@@ -35,12 +36,12 @@ final class Uuid2 extends BaseUuid
3536
public function __construct(
3637
string $field,
3738
bool $nullable = false,
38-
private DceDomain|int|null $localDomain = null,
39+
DceDomain|int|null $localDomain = null,
3940
private readonly ?int $localIdentifier = null,
4041
private readonly int|string|null $node = null,
4142
private readonly ?int $clockSeq = null,
4243
) {
43-
$this->localDomain = \is_int($this->localDomain) ? DceDomain::from($this->localDomain) : $this->localDomain;
44+
$this->localDomain = \is_int($localDomain) ? DceDomain::from($localDomain) : $localDomain;
4445
$this->factory = new UuidV2Factory();
4546
parent::__construct($field, $nullable);
4647
}

src/Listener/Uuid3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
final class Uuid3 extends Base
1616
{
17-
private UuidFactory $factory;
17+
private readonly UuidFactory $factory;
1818

1919
/**
2020
* @param non-empty-string $field The name of the field to store the UUID

src/Listener/Uuid5.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
final class Uuid5 extends Base
1616
{
17-
private UuidFactory $factory;
17+
private readonly UuidFactory $factory;
1818

1919
/**
2020
* @param non-empty-string $field The name of the field to store the UUID

0 commit comments

Comments
 (0)