use null coalescing assignment instead of just null coalescing

This commit is contained in:
Mark Magyar
2023-05-28 18:58:39 +02:00
parent c2183e16b3
commit 9bc454f425
+2 -2
View File
@@ -166,7 +166,7 @@ class TwoFactorAuth
public function getQrCodeProvider(): IQRCodeProvider
{
// Set default QR Code provider if none was specified
return $this->qrcodeprovider ?? ($this->qrcodeprovider = new QRServerProvider());
return $this->qrcodeprovider ??= new QRServerProvider();
}
/**
@@ -192,7 +192,7 @@ class TwoFactorAuth
public function getTimeProvider(): ITimeProvider
{
// Set default time provider if none was specified
return $this->timeprovider ?? ($this->timeprovider = new LocalMachineTimeProvider());
return $this->timeprovider ??= new LocalMachineTimeProvider();
}
/**