Skip to content
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

[5.5] Fixed cache repository setMultiple with an iterator #29038

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

GrahamCampbell
Copy link
Member

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

@GrahamCampbell
Copy link
Member Author

Ultimately, this is why {@inheritdoc} is a bad idea... It's not human readable, so whoever wrote this code originally didn't know the param was iterable and not array.

@taylorotwell taylorotwell merged commit a493425 into 5.5 Jul 3, 2019
@driesvints driesvints deleted the 5.5-cache-set-multiple branch July 4, 2019 08:56
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