return $this->redis->
get((string) $key) ===
$this->
getUniqueToken($key);
} private function evaluate(string
$script, string
$resource, array
$args) { if ($this->redis instanceof \Redis ||
$this->redis instanceof Relay ||
$this->redis instanceof \RedisCluster
) { return $this->redis->
eval($script,
array_merge([$resource],
$args), 1
);
} if ($this->redis instanceof \RedisArray
) { return $this->redis->
_instance($this->redis->
_target($resource))->
eval($script,
array_merge([$resource],
$args), 1
);
} if ($this->redis instanceof \Predis\ClientInterface
) { return $this->redis->
eval(...
array_merge([$script, 1,
$resource],
$args));
} throw new InvalidArgumentException(sprintf('"%s()" expects being initialized with a Redis, Relay, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__,
get_debug_type($this->redis
)));
} private function getUniqueToken(Key
$key): string
{