Skip to content

Commit f035fcb

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: Minor tweak [LockableTrait]Do not redeclare $lockFactory through constructor property promotion in the code example
2 parents 41e1d90 + eb39726 commit f035fcb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

console/lockable_trait.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,13 @@ a ``$lockFactory`` property with your own lock factory::
5555
{
5656
use LockableTrait;
5757

58-
public function __construct(private LockFactory $lockFactory)
58+
// don't use PHP constructor property promotion here because the
59+
// LockableTrait already defines the `$lockFactory` property in this class
60+
public function __construct(LockFactory $lockFactory)
5961
{
62+
$this->lockFactory = $lockFactory;
63+
64+
parent::__construct();
6065
}
6166

6267
// ...

0 commit comments

Comments
 (0)