public function rename($key, $newkey)
    {
        if ($key === $newkey) {
            throw new Exception('ERR source and destination objects are the same');
        } elseif (!$this->storage->hasKey($key)) {
            throw new Exception('ERR no such key');
        }

        if ($this->storage->hasKey($newkey)) {
            $this->del($newkey);
        }

        $this->storage->rename($key, $newkey);

        return true;
    }
public function rename($key, $newkey)
    {
        if ($key === $newkey) {
            throw new Exception('ERR source and destination objects are the same');
        } elseif (!$this->storage->hasKey($key)) {
            throw new Exception('ERR no such key');
        }

        if ($this->storage->hasKey($newkey)) {
            $this->del($newkey);
        }

        $this->storage->rename($key, $newkey);

        return true;
    }
public function rename ( $ key , $ newkey ) { if ( $ key === $ newkey ) { throw new Exception ( 'ERR source and destination objects are the same' ) ; } elseif ( ! $ this -> storage -> hasKey ( $ key ) ) { throw new Exception ( 'ERR no such key' ) ; } if ( $ this -> storage -> hasKey ( $ newkey ) ) { $ this -> del ( $ newkey ) ; } $ this -> storage -> rename ( $ key , $ newkey ) ; return true ; }
StatusReply
StatusReply