Skip to content

Commit

Permalink
[UserBundle] Upgrade endroid/qr-code package (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
DumitracheAdrian authored Nov 25, 2024
1 parent 13bb969 commit 3a33e42
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"doctrine/doctrine-fixtures-bundle": "^3.5",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/sql-formatter": "^1.1",
"endroid/qr-code": "^5.0",
"endroid/qr-code": "^6.0",
"ext-pcntl": "*",
"firebase/php-jwt": "^6.1",
"monolog/monolog": "^3.5.0",
Expand Down Expand Up @@ -305,4 +305,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sonata-integration-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"phpunit/phpunit": "^11.3",
"scheb/2fa-bundle": "^6.0",
"scheb/2fa-email": "^6.0",
"endroid/qr-code": "^5.0",
"endroid/qr-code": "^6.0",
"scheb/2fa-totp": "^6.0"
},
"minimum-stability": "dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@
namespace Draw\Bundle\UserBundle\Security\TwoFactorAuthentication;

use Endroid\QrCode\Builder\Builder;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\RoundBlockSizeMode;
use Endroid\QrCode\Writer\Result\ResultInterface;
use Endroid\QrCode\Writer\SvgWriter;

class QrCodeGenerator
{
public function getTotpQrCode(string $qrCodeContent): ResultInterface
{
return Builder::create()
->writer(new SvgWriter())
->writerOptions([])
->data($qrCodeContent)
->encoding(new Encoding('UTF-8'))
->errorCorrectionLevel(ErrorCorrectionLevel::High)
->size(200)
->margin(0)
->roundBlockSizeMode(RoundBlockSizeMode::Margin)
->build()
;
return (new Builder(
new SvgWriter(),
data: $qrCodeContent,
errorCorrectionLevel: ErrorCorrectionLevel::High,
size: 200,
margin: 0,
))->build();
}
}
2 changes: 1 addition & 1 deletion packages/user-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"draw/messenger": "^0.15",
"draw/security": "^0.15",
"draw/tester": "^0.15",
"endroid/qr-code": "^5.0",
"endroid/qr-code": "^6.0",
"firebase/php-jwt": "^6.1",
"phpunit/phpunit": "^11.3",
"scheb/2fa-bundle": "^6.0",
Expand Down

0 comments on commit 3a33e42

Please sign in to comment.