|
6 | 6 |
|
7 | 7 | use Endroid\QrCode\Builder\Builder; |
8 | 8 | use Endroid\QrCode\Encoding\Encoding; |
9 | | -use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh; |
10 | | -use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin; |
| 9 | +use Endroid\QrCode\ErrorCorrectionLevel; |
| 10 | +use Endroid\QrCode\RoundBlockSizeMode; |
11 | 11 | use Endroid\QrCode\Writer\PngWriter; |
12 | 12 | use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleAuthenticatorTwoFactorInterface; |
13 | 13 | use Scheb\TwoFactorBundle\Model\Totp\TwoFactorInterface as TotpTwoFactorInterface; |
@@ -45,16 +45,17 @@ public function displayTotpQrCode(TokenStorageInterface $tokenStorage, TotpAuthe |
45 | 45 |
|
46 | 46 | private function displayQrCode(string $qrCodeContent): Response |
47 | 47 | { |
48 | | - $result = Builder::create() |
49 | | - ->writer(new PngWriter()) |
50 | | - ->writerOptions([]) |
51 | | - ->data($qrCodeContent) |
52 | | - ->encoding(new Encoding('UTF-8')) |
53 | | - ->errorCorrectionLevel(new ErrorCorrectionLevelHigh()) |
54 | | - ->size(200) |
55 | | - ->margin(0) |
56 | | - ->roundBlockSizeMode(new RoundBlockSizeModeMargin()) |
57 | | - ->build(); |
| 48 | + $builder = new Builder( |
| 49 | + writer: new PngWriter(), |
| 50 | + writerOptions: [], |
| 51 | + data: $qrCodeContent, |
| 52 | + encoding: new Encoding('UTF-8'), |
| 53 | + errorCorrectionLevel: ErrorCorrectionLevel::High, |
| 54 | + size: 200, |
| 55 | + margin: 0, |
| 56 | + roundBlockSizeMode: RoundBlockSizeMode::Margin, |
| 57 | + ); |
| 58 | + $result = $builder->build(); |
58 | 59 |
|
59 | 60 | return new Response($result->getString(), 200, ['Content-Type' => 'image/png']); |
60 | 61 | } |
|
0 commit comments