Problem/Motivation
The following deprecation warning is triggered after writing a QR code image:
Deprecated function: Endroid\QrCode\Writer\PngWriter::write(): Implicitly marking parameter $logo as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /[..]/vendor/composer/ClassLoader.php).
Proposed resolution
This issue has been fixed upstream since the 6.1.0 release (see this commit). Let's make the module compatible with this version of the library.
Issue fork endroid_qr_code-3568723
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
nickolajAs suggested in the issue, this patch makes the module compatible with endroid/qr-code library v6.1+ where
the implicit nullable parameter deprecation was fixed.
Changes:
- Updated `composer.json` to require `endroid/qr-code: ^6.1`
- Refactored `QRImageResponse.php` to use the new v6 API with named constructor arguments
- Updated imports to use the new class locations (e.g., `ErrorCorrectionLevel` enum, `RoundBlockSizeMode`
enum)
- Properly initialize `$logo` and `$label` to `null` before conditional blocks
Comment #5
dieterholvoet commentedFixes it for me!
Comment #7
dieterholvoet commented