Skip to content

Commit 3daf6a9

Browse files
committed
Fixed DateTime issues.
1 parent 21d1321 commit 3daf6a9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Query/Builder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Rennokki\QueryCache\Query;
44

5-
use DateTime;
65
use Illuminate\Database\Query\Builder as BaseBuilder;
76
use Rennokki\QueryCache\Contracts\QueryCacheModuleInterface;
87
use Rennokki\QueryCache\Traits\QueryCacheModule;

src/Traits/QueryCacheModule.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Rennokki\QueryCache\Traits;
44

5-
use Carbon\Carbon;
5+
use DateTime;
66

77
trait QueryCacheModule
88
{
99
/**
1010
* The number of seconds or the DateTime instance
1111
* that specifies how long to cache the query.
1212
*
13-
* @var int|\DateTime|\Carbon\Carbon
13+
* @var int|\DateTime
1414
*/
1515
protected $cacheTime;
1616

@@ -69,7 +69,7 @@ public function getFromQueryCache(string $method = 'get', $columns = ['*'])
6969
$callback = $this->getQueryCacheCallback($method, $columns);
7070
$time = $this->getCacheTime();
7171

72-
if ($time instanceof DateTime || $time instanceof Carbon || $time > 0) {
72+
if ($time instanceof DateTime || $time > 0) {
7373
return $cache->remember($key, $time, $callback);
7474
}
7575

@@ -188,7 +188,7 @@ public function flushQueryCacheWithTag(string $tag): bool
188188
/**
189189
* Indicate that the query results should be cached.
190190
*
191-
* @param \DateTime|\Carbon\Carbon|int $time
191+
* @param \DateTime|int $time
192192
* @return \Rennokki\QueryCache\Query\Builder
193193
*/
194194
public function cacheFor($time)
@@ -329,7 +329,7 @@ public function shouldUsePlainKey(): bool
329329
/**
330330
* Get the cache time attribute.
331331
*
332-
* @return int|\DateTime|\Carbon\Carbon
332+
* @return int|\DateTime
333333
*/
334334
public function getCacheTime()
335335
{

0 commit comments

Comments
 (0)