code: 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;
      }
docs: @param int $times
  
  @return mixed[]