Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5232e0d

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

File tree

Expand file treeCollapse file tree

1 file changed

+2
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-8
lines changed

‎components/uid.rst

Copy file name to clipboardExpand all lines: components/uid.rst
+2-8Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.