cache
cache copied to clipboard
Support `iterable` type for all methods working with multiple keys
This changeset adds support for the iterable type for all methods working with multiple keys. This is done to bring the CacheInterface more in line with PSR-16 which also happens to support the iterable type (as originally suggested in #32).
- The
setMultiple()method now acceptsiterable<string,mixed> $valuesinstead ofarray<string,mixed>. For consumers, passing anarraycontinues to work like usual, but implementations of theCacheInterfacemay have to be adjusted to accept theiterabletype. - The
deleteMultiple()method now acceptsiterable<string> $keysinstead ofstring[]. For consumers, passing anarraycontinues to work like usual, but implementations of theCacheInterfacemay have to be adjusted to accept theiterabletype. - The
getMultiple()method now acceptsiterable<string> $keysinstead ofstring[]and returns aniterable<string,mixed>instead ofarray<string,mixed>. For consumers, passing anarraycontinues to work as usual, but implementations ofCacheInterfacemay have to be adjusted to accept theiterabletype.
Builds on top of #58, #60, #61 and #32 Refs https://github.com/reactphp/promise/pull/225, #30 and others