jsonmapper icon indicating copy to clipboard operation
jsonmapper copied to clipboard

Add support for PHP 8.4 and 8.5

Open mpesari opened this issue 3 months ago • 1 comments

General

  • Fail phpunit tests on all issues (PHP warnings, deprecations etc.)

PHP 8.4

  • Run tests on PHP 8.4
  • Fix deprecated use of implicitly nullable parameters
    • This feature is available since PHP 7.1, which is the lowest supported version in composer.json, so there are no backward compatibility issues
    • https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.nullable-types
    • https://www.php.net/manual/en/migration84.deprecated.php#migration84.deprecated.core.implicitly-nullable-parameter

PHP 8.5

  • Run tests on PHP 8.5
  • Fix deprecated use of null as array key
    • Not sure why null is used here as array key, but this doesn't change code behaviour
    • https://www.php.net/manual/en/migration85.deprecated.php#migration85.deprecated.core.using-null-as-an-array-offset
  • Fix deprecated use of Reflection setAccessible()
    • The method is noop since PHP 8.1.0 and deprecated since 8.5.0
    • This changes the code to call setAccessible() only on PHP < 8.1.0, where it does something
    • https://www.php.net/manual/en/migration81.other-changes.php#migration81.other-changes.functions.reflection
    • https://www.php.net/manual/en/migration85.deprecated.php#migration85.deprecated.reflection

mpesari avatar Nov 27 '25 12:11 mpesari

Thank you for this contribution. I don't see any issues, and the PHP version check respects the established practice.

I hope Christian has time to merge and release it.

SvenRtbg avatar Nov 27 '25 18:11 SvenRtbg