Skip to content

Commit 5232e0d

Browse files
[Uid] Use constructor property promotion for UuidFactory and UlidFactory examples
1 parent 6f2875c commit 5232e0d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

components/uid.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,8 @@ on the configuration you defined::
146146

147147
class FooService
148148
{
149-
private UuidFactory $uuidFactory;
150-
151-
public function __construct(UuidFactory $uuidFactory)
149+
public function __construct(private UuidFactory $uuidFactory)
152150
{
153-
$this->uuidFactory = $uuidFactory;
154151
}
155152

156153
public function generate(): void
@@ -337,11 +334,8 @@ Like UUIDs, ULIDs have their own factory, ``UlidFactory``, that can be used to g
337334

338335
class FooService
339336
{
340-
private UlidFactory $ulidFactory;
341-
342-
public function __construct(UlidFactory $ulidFactory)
337+
public function __construct(private UlidFactory $ulidFactory)
343338
{
344-
$this->ulidFactory = $ulidFactory;
345339
}
346340

347341
public function generate(): void

0 commit comments

Comments
 (0)