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] Cache: allows DateInterface and DateInterval #20034

Merged
merged 1 commit into from
Jul 13, 2017
Merged

[5.5] Cache: allows DateInterface and DateInterval #20034

merged 1 commit into from
Jul 13, 2017

Conversation

lucasmichot
Copy link
Contributor

@lucasmichot lucasmichot commented Jul 13, 2017

At the moment when using the Cache repository, we can only pass an instance of \DateTime or an integer for the duration.


This is therefore impossible to use \DateTimeImmutable for example.
Also we sometimes wish to use a \DateInterval.


This PR allows to use any kind of \DateInterface, \DateInterval and integers

@@ -37,7 +37,7 @@ public function pull($key, $default = null);
*
* @param string $key
* @param mixed $value
* @param \DateTime|float|int $minutes
* @param \DateTimeInterface|\DateInterval|float|int $minutes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could probably have mixed there, but I've let this on purpose; this can be modified before 5.5 release if necessary.

@taylorotwell taylorotwell merged commit 11df2df into laravel:master Jul 13, 2017
@lucasmichot lucasmichot deleted the feature/master/cache branch July 13, 2017 13:11
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