chillerlan / php-qrcode

A PHP QR Code generator and reader with a user-friendly API.
https://smiley.codes/qrcode/
Apache License 2.0
2k stars 297 forks source link

PHP 8.4 deprecation of implicit nullable #276

Open campbell-m opened 3 months ago

campbell-m commented 3 months ago

Running QRCode against PHP 8.4.0alpha1 gives a number of E_DEPRECATED error messages, eg

E_DEPRECATED in C:\inetpub\wwwroot\abcd\lib\chillerlan\QRCode\QRCode.php at line 80
chillerlan\QRCode\QRCode::render(): Implicitly marking parameter $data as nullable is deprecated, the explicit nullable type must be used instead
codemasher commented 3 months ago

Hey, I am aware of this issue (https://wiki.php.net/rfc/deprecate-implicitly-nullable-types). PHP 8.4 is a couple more months down the road, implicit nullables will be fixed until then.

campbell-m commented 3 months ago

OK, thanks.

codemasher commented 3 months ago

Just as a heads-up, this is what currently happens when I enable PHP 8.4 on CI: https://github.com/chillerlan/php-settings-container/actions/runs/9947535033/job/27480365765 (spoiler: countless warnings from dev-dependencies)

codemasher commented 3 months ago

@campbell-m I've pushed a fix to address this issue to the v4 and v5 as well as dev-main (upcoming v6) branches. Can you perhaps check if this resolves the issue for you?

The composer tags are:

campbell-m commented 3 months ago

Many thanks. That seems to fix the issues.

codemasher commented 3 months ago

I'm going to reopen this as this is probably not done yet. It's still not possible to run tests on CI under PHP 8.4 as dependencies will cause trouble.