original_string: private function reindex(int $capacity): void
      {
          $temp = [];
          for ($i = 0; $i < $this->count; $i++) {
              $temp[$i] = $this->items[($i + $this->front) % $this->cap];
          }
          $this->items = $temp;
          $this->cap = $capacity;
          $this->front = 0;
          $this->end = $this->count;
      }
code: private function reindex(int $capacity): void
      {
          $temp = [];
          for ($i = 0; $i < $this->count; $i++) {
              $temp[$i] = $this->items[($i + $this->front) % $this->cap];
          }
          $this->items = $temp;
          $this->cap = $capacity;
          $this->front = 0;
          $this->end = $this->count;
      }
code_tokens: private function reindex ( int $ capacity ) : void { $ temp = [ ] ; for ( $ i = 0 ; $ i < $ this -> count ; $ i ++ ) { $ temp [ $ i ] = $ this -> items [ ( $ i + $ this -> front ) % $ this -> cap ] ; } $ this -> items = $ temp ; $ this -> cap = $ capacity ; $ this -> front = 0 ; $ this -> end = $ this -> count ; }
docstring: Re-indexes the underlying array
  
  This is needed to keep wrapping under control. Using direct indices
  allows operations in constant amortized time instead of O(n).
  
  Using array_(un)shift is easier, but requires re-indexing the array
  every time during the enqueue or dequeue operation.
  
  @param int $capacity The new capacity
  
  @return void
docstring_tokens: Re - indexes the underlying array