-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[12.x] ArrayStore::all()
#56751
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
[12.x] ArrayStore::all()
#56751
Conversation
|
You can use Carbon::setTestNow to see if it expires. No need to extract the data. But if you truly must, I doubt this will be accepted, use closures with binding. |
I bound the ArrayStore to a Closure, as you mentioned. But that doesn't feel particularly ergonomic, especially for a driver that I assume is primarily used in tests. 🤷 |
True, but generally you don't test laravel, you test your own input. In this case TTL. Using Carbon setTestNow is the best way. And if that doesn't suit your needs, this is the next best. They are not going to add this unless everyone really benefits from it and not just because you say so. |
|
Hello @cosmastech After this PR, the new |
The use-case I envisioned here was to simplify testing when using the ArrayStore for the cache driver. I personally did not intend to add this to all drivers. |
I needed a way to extract the data from the ArrayStore inside of a test. While I could get the value of many records and adjust the Carbon timestamp to see when they expire, this doesn't seem particularly developer-friendly.