8000 Support `iterable` type for all methods working with multiple keys by clue · Pull Request #62 · reactphp/cache · GitHub
[go: up one dir, main page]

Skip to content

Support iterable type for all methods working with multiple keys #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

clue
Copy link
Member
@clue clue commented Jul 6, 2024

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 accepts iterable<string,mixed> $values instead of array<string,mixed>. For consumers, passing an array continues to work like usual, but implementations of the CacheInterface may have to be adjusted to accept the iterable type.
  • The deleteMultiple() method now accepts iterable<string> $keys instead of string[]. For consumers, passing an array continues to work like usual, but implementations of the CacheInterface may have to be adjusted to accept the iterable type.
  • The getMultiple() method now accepts iterable<string> $keys instead of string[] and returns an iterable<string,mixed> instead of array<string,mixed>. For consumers, passing an array continues to work as usual, but implementations of CacheInterface may have to be adjusted to accept the iterable type.

Builds on top of #58, #60, #61 and #32
Refs reactphp/promise#225, #30 and others

@clue clue added this to the v3.0.0 milestone Jul 6, 2024
@clue clue requested review from WyriHaximus and SimonFrings July 6, 2024 19:46
Copy link
Member
@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@WyriHaximus WyriHaximus merged commit d4869f4 into reactphp:3.x Jan 3, 2025
16 checks passed
@clue clue deleted the iterable branch January 3, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0