Skip to content

Commit

Permalink
Merge pull request #16 from php-cache/expiration_date
Browse files Browse the repository at this point in the history
Make sure we check with expiration date if we got one
  • Loading branch information
cryptiklemur committed Jan 23, 2016
2 parents 4fb5595 + 62a3c24 commit 7274cda
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CacheItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ public function isHit()
return false;
}

if ($this->expirationDate !== null) {
return $this->expirationDate > new \DateTime();
}

return true;
}

Expand Down

0 comments on commit 7274cda

Please sign in to comment.