Skip to content

Commit

Permalink
Issue #3108751 by nitesh624, Berdir: Drupal 9 Deprecated Code Report
Browse files Browse the repository at this point in the history
  • Loading branch information
nitesh624 authored and Berdir committed Jan 26, 2020
1 parent 453f58d commit 3a60449
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Cache/CacheBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ protected function getExpiration($expire) {
if ($expire == Cache::PERMANENT || $expire > $this->permTtl) {
return $this->permTtl;
}
return $expire - REQUEST_TIME;
return $expire - \Drupal::time()->getRequestTime();
}

/**
* Return the key for the tag used to specify the bin of cache-entries.
*/
Expand Down Expand Up @@ -259,7 +258,7 @@ protected function expandEntry(array $values, $allow_invalid) {
// Check expire time, allow to have a cache invalidated explicitly, don't
// check if already invalid.
if ($cache->valid) {
$cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= REQUEST_TIME;
$cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= \Drupal::time()->getRequestTime();

// Check if invalidateTags() has been called with any of the items's tags.
if ($cache->valid && !$this->checksumProvider->isValid($cache->checksum, $cache->tags)) {
Expand Down

0 comments on commit 3a60449

Please sign in to comment.