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.

Command icon 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

dieterholvoet created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

As 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

dieterholvoet’s picture

Status: Needs review » Reviewed & tested by the community

Fixes it for me!

dieterholvoet’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.