mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 20:53:44 +00:00
use null coalescing assignment instead of just null coalescing
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user