/** * @param $key * @param callable $closure * @param int $ttl * @return Key */ public function __invoke($key, \Closure $closure, $ttl = 86400) { $keyObj = new Key($this->predis, $key); $keyObj->setKeyPrefix($this->keyPrefix); $keyObj->setTtl($ttl); $keyObj->setClosure($closure); $keyObj->setOnHit($this->onHit); $keyObj->setOnMiss($this->onMiss); $keyObj->setEnabled($this->enabled); return $keyObj; }