From 5232e0d8b24edc5b7b7a284151f167c6c664e8ff Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 9 Jan 2023 18:33:13 +0100 Subject: [PATCH] [Uid] Use constructor property promotion for UuidFactory and UlidFactory examples --- components/uid.rst | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/uid.rst b/components/uid.rst index 0af55566165..332d523eae2 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -146,11 +146,8 @@ on the configuration you defined:: class FooService { - private UuidFactory $uuidFactory; - - public function __construct(UuidFactory $uuidFactory) + public function __construct(private UuidFactory $uuidFactory) { - $this->uuidFactory = $uuidFactory; } public function generate(): void @@ -337,11 +334,8 @@ Like UUIDs, ULIDs have their own factory, ``UlidFactory``, that can be used to g class FooService { - private UlidFactory $ulidFactory; - - public function __construct(UlidFactory $ulidFactory) + public function __construct(private UlidFactory $ulidFactory) { - $this->ulidFactory = $ulidFactory; } public function generate(): void