From 76b4637fe346b4ee56eaec43dbfe61baa5342c0d Mon Sep 17 00:00:00 2001 From: Zaher Thaifani Date: Wed, 19 Aug 2026 17:39:08 +0300 Subject: [PATCH 1/2] 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); } } From 108bc25f09b34089ee812d1d4696ea9e26ee44db Mon Sep 17 00:00:00 2001 From: Zaher Thaifani Date: Wed, 19 Aug 2026 20:37:54 +0300 Subject: [PATCH 2/2] feat(CPD-31586)!: `chillerlan/php-qrcode` from v4 to v5 Re-applies the upgrade that shipped in 3.0.5 and was reverted in #71, so it can be released under a major version instead of a patch. Restores the `^5.0` constraint, the QROutputInterface import and the GDIMAGE_PNG/imageTransparent defaults in render(). Also updates the CLAUDE.md stack list, which still referenced ^4.3. BREAKING CHANGE: chillerlan/php-qrcode v5 renames the QROptions keys and output constants used by GenerateQrCode::render(). Callers passing v4-style options must migrate. Release this as 4.0.0, not 3.0.x. Reverts 76b4637 (#71), reinstating a296af9 (#65) --- CLAUDE.md | 2 +- composer.json | 2 +- src/GenerateQrCode.php | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index dccbf8a..1325022 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,7 +7,7 @@ A PHP composer library (`salla/zatca`) that implements ZATCA (Fatoora) e-invoici - `phpseclib/phpseclib ~3.0` — EC key handling and X.509 certificate parsing - `robrichards/xmlseclibs ^3.1` — XML digital signature support - `josemmo/uxml ^0.1.4` — UBL XML parsing/manipulation -- `chillerlan/php-qrcode ^4.3` — QR code image rendering +- `chillerlan/php-qrcode ^5.0` — QR code image rendering - `phpunit/phpunit ~8.0` (dev) ## Run / test / build diff --git a/composer.json b/composer.json index 94a0156..09fb2ab 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": "^4.3", + "chillerlan/php-qrcode": "^5.0", "phpseclib/phpseclib": "~3.0" }, "require-dev": { diff --git a/src/GenerateQrCode.php b/src/GenerateQrCode.php index fa3512b..c4196cb 100644 --- a/src/GenerateQrCode.php +++ b/src/GenerateQrCode.php @@ -5,6 +5,7 @@ use chillerlan\QRCode\QRCode; use InvalidArgumentException; use chillerlan\QRCode\QROptions; +use chillerlan\QRCode\Output\QROutputInterface; class GenerateQrCode { @@ -74,7 +75,16 @@ 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); } }