Skip to content

[5.8] Fixed cache repository setMultiple with an iterator - #29039

Merged
taylorotwell merged 1 commit into
5.8from
5.8-cache-set-multiple
Jul 3, 2019
Merged

taylorotwell merged 1 commit into
5.8from
5.8-cache-set-multiple

Conversation

@GrahamCampbell

Copy link
Copy Markdown
Collaborator

The Psr\SimpleCache\CacheInterface interface we implement says that an arbitrary iterable can be passed to setMultiple, thus we need to convert it to an array before we pass it to putMany.


Without this fix, the following error will occur it something iterable that's not an array is used:

TypeError: Argument 1 passed to Illuminate\Cache\Repository::putMany() must be of the type array, object given, called in /data/src/Illuminate/Cache/Repository.php on line 232

/data/src/Illuminate/Cache/Repository.php:216
/data/src/Illuminate/Cache/Repository.php:232

@taylorotwell
taylorotwell merged commit b038bdc into 5.8 Jul 3, 2019
@driesvints
driesvints deleted the 5.8-cache-set-multiple branch July 4, 2019 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants