Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
fix(class/cache): Fix magic call may cause exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Jul 20, 2019
1 parent 9913873 commit 5d1434c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions framework/Utils/ClassValueCacheUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ protected function getCacheNameSpace(): string

protected function getCacheValue($key, $closure)
{
if (is_null($this->{$key})) {
$this->{$key} = app()->redis->hGet($this->getCacheNameSpace(), $key);
if (false === $this->{$key}) {
$this->{$key} = $closure();
app()->redis->hSet($this->getCacheNameSpace(), $key, $this->{$key});
if (is_null($this->$key)) {
$this->$key = app()->redis->hGet($this->getCacheNameSpace(), $key);
if (false === $this->$key) {
$this->$key = $closure();
app()->redis->hSet($this->getCacheNameSpace(), $key, $this->$key);
}
}
return $this->{$key};
return $this->$key;
}
}

0 comments on commit 5d1434c

Please sign in to comment.