Unleash/unleash-client-php

Feat: Allow installation with psr/simple-cache 3.x

colinodell opened this issue · 0 comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the new feature

I would like this library to support psr/simple-cache 3.x

Is your feature request related to a problem? (optional)

I'm using a third-party cache adapter that requires psr/simple-cache: ^3.0 which is preventing me from installing this library.

Describe alternatives you've considered (optional)

I could fork the cache adapter and manually make it support 1.x, or downgrade to an older version, but neither approach seems ideal. And those workarounds wouldn't help other users who also want to use the latest PSR interfaces.

Additional context (optional)

This library could easily support this new version with no src code changes needed - simply widening the constraints in composer.json would be sufficient:

-       "psr/simple-cache": "^1.0",
-       "psr/simple-cache-implementation": "^1.0",
+       "psr/simple-cache": "^1.0 | ^2.0 | ^3.0",
+       "psr/simple-cache-implementation": "^1.0 | ^2.0 | ^3.0",

Unfortunately, the test suite will never run on these higher versions because the cache/filesystem-adapter dev dependency only supports 1.x:

image

This could be worked around by making this an optional dependency (where we'd remove it from composer.json but conditionally composer require it in the CI pipeline matrix). I'll open a PR shortly that uses this approach to better explain how it would work.