Skip to content

Commit 6f98563

Browse files
committed
AC-13306::Adobe Commerce 2.4.8 core code is compatible with PHP 8.4
1 parent 16927e1 commit 6f98563

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

TwoFactorAuth/Model/Provider/Engine/Google.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
use Base32\Base32;
1111
use Endroid\QrCode\Color\Color;
1212
use Endroid\QrCode\Encoding\Encoding;
13+
use Endroid\QrCode\ErrorCorrectionLevel;
1314
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh;
1415
use Endroid\QrCode\QrCode;
16+
use Endroid\QrCode\RoundBlockSizeMode;
1517
use Endroid\QrCode\Writer\PngWriter;
1618
use Exception;
1719
use Magento\Framework\App\Config\ScopeConfigInterface;
@@ -214,13 +216,17 @@ public function verify(UserInterface $user, DataObject $request): bool
214216
public function getQrCodeAsPng(UserInterface $user): string
215217
{
216218
// @codingStandardsIgnoreStart
217-
$qrCode = new QrCode($this->getProvisioningUrl($user));
218-
$qrCode->setSize(400);
219-
$qrCode->setMargin(0);
220-
$qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevelHigh());
221-
$qrCode->setForegroundColor(new Color(0, 0, 0, 0));
222-
$qrCode->setBackgroundColor(new Color(255, 255, 255, 0));
223-
$qrCode->setEncoding(new Encoding('UTF-8'));
219+
$qrCode = new QrCode(
220+
$this->getProvisioningUrl($user),
221+
new Encoding('UTF-8'),
222+
ErrorCorrectionLevel::High,
223+
400,
224+
0,
225+
RoundBlockSizeMode::Margin,
226+
new Color(0, 0, 0, 0),
227+
new Color(255, 255, 255, 0)
228+
);
229+
224230

225231
$writer = new PngWriter();
226232
$pngData = $writer->write($qrCode);

0 commit comments

Comments
 (0)