Skip to content

Commit

Permalink
Make volume lookup cache the Volume class instead of an stdClass
Browse files Browse the repository at this point in the history
  • Loading branch information
tystuyfzand committed May 23, 2018
1 parent 0b82770 commit 94e5304
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SeaweedFS.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ public function lookup($id) {

$body = json_decode((string) $res->getBody());

$volume = new Volume($body);

if ($this->cache) {
$this->cache->put($cacheKey, $body);
$this->cache->put($cacheKey, $volume);
}

return new Volume($body);
return $volume;
}

/**
Expand Down

0 comments on commit 94e5304

Please sign in to comment.