public function rpoplpush(string $sourceList, string $destinationList)
    {
        // RPOP (get last value of the $sourceList)
        $rpopValue = $this->rpop($sourceList);

        // LPUSH (send the value at the end of the $destinationList)
        if (null !== $rpopValue){
            $this->lpush($destinationList, $rpopValue);
        }

        // return the rpop value;
        return $rpopValue;
    }
public function rpoplpush(string $sourceList, string $destinationList)
    {
        // RPOP (get last value of the $sourceList)
        $rpopValue = $this->rpop($sourceList);

        // LPUSH (send the value at the end of the $destinationList)
        if (null !== $rpopValue){
            $this->lpush($destinationList, $rpopValue);
        }

        // return the rpop value;
        return $rpopValue;
    }
public function rpoplpush ( string $ sourceList , string $ destinationList ) { // RPOP (get last value of the $sourceList) $ rpopValue = $ this -> rpop ( $ sourceList ) ; // LPUSH (send the value at the end of the $destinationList) if ( null !== $ rpopValue ) { $ this -> lpush ( $ destinationList , $ rpopValue ) ; } // return the rpop value; return $ rpopValue ; }
Mock the `rpoplpush` command
@see https://redis.io/commands/rpoplpush
@param string $sourceList
@param string $destinationList
@return RedisMock
Mock the rpoplpush command