src/BTR/RedisObjects/RedisObject.php
public function renameNx($name): bool
    {
        if ($name instanceof self) {
            $name = $name->key;
        }
        $ret = $this->redis->renamenx($this->key, $name);
        if ($ret === self::RESPONSE_SUCCESS) {
            $this->key = $name;

            return true;
        }

        return false;
    }
public function renameNx($name): bool
    {
        if ($name instanceof self) {
            $name = $name->key;
        }
        $ret = $this->redis->renamenx($this->key, $name);
        if ($ret === self::RESPONSE_SUCCESS) {
            $this->key = $name;

            return true;
        }

        return false;
    }
@param RedisObject|string $name Key or other RedisObject as new key.

@return bool True if key was renamed. False if key already exists.