Skip to content

Commit 9bc454f

Browse files
committed
use null coalescing assignment instead of just null coalescing
1 parent c2183e1 commit 9bc454f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/TwoFactorAuth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function getQRText(string $label, string $secret): string
166166
public function getQrCodeProvider(): IQRCodeProvider
167167
{
168168
// Set default QR Code provider if none was specified
169-
return $this->qrcodeprovider ?? ($this->qrcodeprovider = new QRServerProvider());
169+
return $this->qrcodeprovider ??= new QRServerProvider();
170170
}
171171

172172
/**
@@ -192,7 +192,7 @@ public function getRngProvider(): IRNGProvider
192192
public function getTimeProvider(): ITimeProvider
193193
{
194194
// Set default time provider if none was specified
195-
return $this->timeprovider ?? ($this->timeprovider = new LocalMachineTimeProvider());
195+
return $this->timeprovider ??= new LocalMachineTimeProvider();
196196
}
197197

198198
/**

0 commit comments

Comments
 (0)