Skip to content

Commit

Permalink
Allow for empty cache when new instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
Israel J. Carberry committed Aug 21, 2020
1 parent d26b2c3 commit b4394e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ET_CacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct($clientId, $clientSecret)
public function get()
{
$now = time();
$data = ET_CacheService::$cachedSoapUrls[$this->_identifier];
$data = ET_CacheService::$cachedSoapUrls[$this->_identifier] ?? null;
if (!$data || !$data->expires || $data->expires < $now) {
// remove expired data from the array
unset(ET_CacheService::$cachedSoapUrls[$this->_identifier]);
Expand All @@ -34,4 +34,4 @@ public function write($url)
$data->url = $url;
ET_CacheService::$cachedSoapUrls[$this->_identifier] = $data;
}
}
}

0 comments on commit b4394e7

Please sign in to comment.