cache = $cache; } /** * @inheritdoc */ public function lock(string $name, int $timeout = -1): bool { return $this->cache->save('1', $name, [], $timeout); } /** * @inheritdoc */ public function unlock(string $name): bool { return $this->cache->remove($name); } /** * @inheritdoc */ public function isLocked(string $name): bool { return (bool)$this->cache->test($name); } }