Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Conversation

mbabker
Copy link

@mbabker mbabker commented Feb 3, 2025

This PR updates the library to silence deprecation notices on PHP 8.4 with implicitly nullable parameters. To try and keep the code diff as small as possible, here's what I did:

  • Bumped PHPUnit dev dependency to latest 9.6 release to ensure all dev dependencies will install with PHP 8.4 (it was previously locked to a transient set of dependencies that couldn't install on PHP 8.2 or later)
  • Bumped PHP-CS-Fixer to latest minor version (as this is a CS tool it doesn't really need to have a wide version range)
  • Ran composer update with the PHP platform config set to 8.1.33 to keep the lockfile compatible with PHP 8.1
  • Ran PHP-CS-Fixer with the config below
    • Note all the random whitespace additions/removals are from the fixer as well)
  • Ran PHPUnit to ensure there weren't any deprecations printed out (and fixed the one dynamic property deprecation that was shown)
  • Committed
<?php declare(strict_types=1);

return (new PhpCsFixer\Config())
    ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
    ->setRules([
        '@PSR12' => true,
        'nullable_type_declaration_for_default_null_value' => [
            'use_nullable_type_declaration' => true,
        ],
    ])
    ->setFinder(
        (new PhpCsFixer\Finder())
            ->in(__DIR__)
            ->ignoreDotFiles(true)
            ->ignoreVCS(true)
    );

@mbabker mbabker requested a review from alexdebril as a code owner February 3, 2025 21:31
@boelew
Copy link

boelew commented Feb 14, 2025

Thanks for this work! I was having the same issues since I upgraded my system to php8.4 and was trying to solve them myself. Quickly found that you did the work already.

I had a look at your changes and it would have my approval.

@stevleibelt
Copy link

@alexdebril please merge this and create a release.

@thedotedge
Copy link

Any chance to merge this and cut a new version?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants