src/BTR/RedisObjects/RedisList.php
public function rotate(int $times = 1): array
    {
        $movedItems = [];
        if ($times === 0) {
            return [];
        }
        if ($times > 0) {
            for ($i = 0; $i < $times; $i++) {
                $movedItems[] = $this->rpoplpush($this);
            }
        } else {
            for ($i = 0; $i > $times; $i--) {
                $content = $this->lpop();
                $this->rpush($content);
                $movedItems[] = $content;
            }
        }

        return $movedItems;
    }
public function rotate(int $times = 1): array
    {
        $movedItems = [];
        if ($times === 0) {
            return [];
        }
        if ($times > 0) {
            for ($i = 0; $i < $times; $i++) {
                $movedItems[] = $this->rpoplpush($this);
            }
        } else {
            for ($i = 0; $i > $times; $i--) {
                $content = $this->lpop();
                $this->rpush($content);
                $movedItems[] = $content;
            }
        }

        return $movedItems;
    }
@param int $times

@return mixed[]