Bacon / BaconQrCode

QR Code Generator for PHP
BSD 2-Clause "Simplified" License
1.82k stars 208 forks source link

Fix implicitly nullable params #175

Closed kamil-tekiela closed 5 months ago

DASPRiD commented 5 months ago

What exactly is wrong with that? Maybe @Chris53897 can shed some light here, since he introduced that.

kamil-tekiela commented 5 months ago

Oh sorry, I should have mentioned the reason. It's because of the deprecation in PHP 8.4.

23) /home/runner/work/phpmyadmin/phpmyadmin/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php:158
Implicitly marking parameter $encoding as nullable is deprecated, the explicit nullable type must be used instead

Triggered by:

* PhpMyAdmin\Tests\TwoFactorTest::testApplication
  /home/runner/work/phpmyadmin/phpmyadmin/tests/unit/TwoFactorTest.php:240

24) /home/runner/work/phpmyadmin/phpmyadmin/vendor/bacon/bacon-qr-code/src/Common/ReedSolomonCodec.php:225
Implicitly marking parameter $erasures as nullable is deprecated, the explicit nullable type must be used instead

Triggered by:

* PhpMyAdmin\Tests\TwoFactorTest::testApplication
  /home/runner/work/phpmyadmin/phpmyadmin/tests/unit/TwoFactorTest.php:240

https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

mfn commented 5 months ago

Rector added it too (afair, php-cs-fixer is also able to auto-fox it), e.g. https://github.com/rectorphp/rector-src/pull/5724

Chris53897 commented 5 months ago

Make it implicit nullable is fine for me. This is the way to go with PHP 7.4

kamil-tekiela commented 5 months ago

Make it implicit nullable is fine for me. This is the way to go with PHP 7.4

Actually, it's since PHP 7.1. Explicit nullability is possible since PHP 7.1, but if your code needs to support PHP 7.0, you'd have to stick with implicit nullability or no types at all.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 64.93%. Comparing base (c01758c) to head (4197cee).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #175 +/- ## ========================================= Coverage 64.93% 64.93% Complexity 981 981 ========================================= Files 48 48 Lines 3094 3094 ========================================= Hits 2009 2009 Misses 1085 1085 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.