Skip to content

Conversation

khoaofgod
Copy link
Member

Proposed changes

This PR fixes the PHP 8.4 deprecation warnings related to implicitly nullable parameters. In PHP 8.4, parameters with a default value of null must be explicitly marked as nullable using the '?' prefix.

Fixes #924 and #926

Changes:

  1. Fixed Redis Config::setDatabase() method (issue PHP8.4 Deprecation message #924)
  2. Fixed PhpfastcacheIOException constructor (issue PHP 8.4 Deprecated Warning: Implicitly nullable parameter $previous in PhpfastcacheIOException::__construct #926)
  3. Fixed additional similar occurrences in:
    • PhpfastcacheCorruptedDataException constructor
    • Psr16Adapter constructor
    • ClusterAggregator::aggregateDriverByName
    • AggregatorInterface::aggregateDriverByName
    • CacheContract::get and __invoke methods

These changes ensure compatibility with PHP 8.4 while maintaining backward compatibility with PHP 8.0+.

Types of changes

What types of changes does your code introduce to Phpfastcache?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing code/behavior)
  • Deprecated third party dependency update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation/Typo/Resource update that does not involve any code modification

Agreement

I have read the CONTRIBUTING and CODING GUIDELINE docs

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@Geolim4
Copy link
Member

Geolim4 commented Apr 30, 2025

Ignore Travis fails as Travis has to be removed asap.

@khoaofgod khoaofgod enabled auto-merge April 30, 2025 04:59
@khoaofgod khoaofgod disabled auto-merge April 30, 2025 05:00
@khoaofgod khoaofgod merged commit 7c91d42 into master Apr 30, 2025
8 of 9 checks passed
@khoaofgod khoaofgod deleted the fix/php84-deprecation-warnings branch April 30, 2025 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants