Skip to content

Commit 7274cda

Browse files
committed
Merge pull request #16 from php-cache/expiration_date
Make sure we check with expiration date if we got one
2 parents 4fb5595 + 62a3c24 commit 7274cda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CacheItem.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ public function isHit()
114114
return false;
115115
}
116116

117+
if ($this->expirationDate !== null) {
118+
return $this->expirationDate > new \DateTime();
119+
}
120+
117121
return true;
118122
}
119123

0 commit comments

Comments
 (0)