From 76b4637fe346b4ee56eaec43dbfe61baa5342c0d Mon Sep 17 00:00:00 2001 From: Zaher Thaifani Date: Wed, 19 Aug 2026 17:39:08 +0300 Subject: [PATCH] revert(CPD-31586): `chillerlan/php-qrcode` back to v4 Reverts the v4 -> v5 upgrade released in 3.0.5. Restores the `^4.3` constraint and the plain QROptions render path, dropping the GDIMAGE_PNG/imageTransparent defaults that only exist in v5. The explicit `?string $file` nullable type is kept, since it is independent of the qrcode major version and avoids a PHP 8.4+ deprecation notice. Reverts a296af94d4f954d807288f4beea51a5424fcb273 (#65) --- composer.json | 2 +- src/GenerateQrCode.php | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 09fb2ab..94a0156 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "ext-dom": "*", "robrichards/xmlseclibs": "^3.1", "josemmo/uxml": "^0.1.4", - "chillerlan/php-qrcode": "^5.0", + "chillerlan/php-qrcode": "^4.3", "phpseclib/phpseclib": "~3.0" }, "require-dev": { diff --git a/src/GenerateQrCode.php b/src/GenerateQrCode.php index c4196cb..fa3512b 100644 --- a/src/GenerateQrCode.php +++ b/src/GenerateQrCode.php @@ -5,7 +5,6 @@ use chillerlan\QRCode\QRCode; use InvalidArgumentException; use chillerlan\QRCode\QROptions; -use chillerlan\QRCode\Output\QROutputInterface; class GenerateQrCode { @@ -75,16 +74,7 @@ public function toBase64(): string */ public function render(array $options = [], ?string $file = null): string { - if (!isset($options['outputType']) && !isset($options['outputInterface'])) { - $options['outputType'] = QROutputInterface::GDIMAGE_PNG; - } - - if (!isset($options['imageTransparent'])) { - $options['imageTransparent'] = true; - } - $options = new QROptions($options); - return (new QRCode($options))->render($this->toBase64(), $file); } }