guzzle-cache-middleware icon indicating copy to clipboard operation
guzzle-cache-middleware copied to clipboard

Support PHP 8.4

Open andrewnicols opened this issue 1 year ago • 4 comments

PHP 8.4 is now in release candidate and due for release in about 6 weeks. Features are now sealed.

This pull request:

  • Add PHP 8.4 tests in the GitHub Action
  • Explicitly declares nullable parameters as nullable

Note: There is still a warning in relation to the GreedyCacheStrategy because the second argument ($defaultTtl) is required, but the first argument is optional. I'm not sure how you wish to resolve this so I'll defer to a separate issue. Options are to either stop the first argument (CacheStorageInterface $cache) from having a default value (but still allowing nullability), or to provide a default of the default ttl.

andrewnicols avatar Oct 02 '24 04:10 andrewnicols

Thank you @andrewnicols for this PR.

I think that we can add a default value to defaultTtl. If we remove the default value to cache, this is potentially a breaking change.

Maybe something like 60.

Kevinrob avatar Oct 04 '24 09:10 Kevinrob

Cheers,

I've set a default value in the constructor of 60. I was tempted to set the type hint (int) but that would be a breaking change so avoided that.

andrewnicols avatar Oct 04 '24 12:10 andrewnicols

There are some errors with 8.4, lowest. Maybe we need to drop some versions on dependencies too?

Kevinrob avatar Oct 07 '24 11:10 Kevinrob

Thanks @Kevinrob ,

I saw these the other day but didn't get a chance to trouble-shoot. I ended up having to reduce some alternate versions, but most of the existing lowest options were unsupported, and all of the highest version options were fully supported.

  • phpunit/phpunit: 8.5.40 does seem to support PHP 8.4 but 9.6 also supports all versions so I felt it best to just bump the version
  • symfony/phpunit-bridge: 5.4 does seem to support PHP 8.4 but 7.1.4 also supports all versions
  • guzzlehttp/guzzle: Version 6.x is no longer maintained. Minimum version now needs to be 7.9.2 to proivde support for the required range of PHP versions
  • guzzlehttp/promises: Version 1.x is no longer supported. Minimum version required is now 2.0.3
  • guzzlehttp/psr7: Version 1.x is no longer maintained. Minimum version requireds is now 2.7.0

andrewnicols avatar Oct 07 '24 15:10 andrewnicols