client = $client; } /** * Gets a value from the cache * * @param string $key * @return Promise */ public function get(string $key): Promise { return $this->client->xcache->get($key)->then('unserialize')->otherwise(function () {}); } /** * Sets a value in the cache * * @param string $key * @param mixed $value * @return Promise */ public function set(string $key, $value): Promise { return $this->client->xcache->set($key, serialize($value))->otherwise(function () {}); } }