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 8677542

Browse filesBrowse files
committed
minor #17699 [Uid] Use constructor property promotion for UuidFactory and UlidFactory examples (alexandre-daubois)
This PR was merged into the 6.0 branch. Discussion ---------- [Uid] Use constructor property promotion for UuidFactory and UlidFactory examples Following `@OskarStark`'s idea (#17690 (comment)), here is a little improvement on Uid factories for 6.0+ 👍 Commits ------- 5232e0d [Uid] Use constructor property promotion for UuidFactory and UlidFactory examples
2 parents 6f2875c + 5232e0d commit 8677542
Copy full SHA for 8677542

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.