original_string: public function merge(self $list) : self
      {
          $oldSize = $this->getSize();
          $combinedSize = $oldSize + $list->getSize();
          $old = $this->list;
          $old->setSize($combinedSize);
  
          foreach ($old as $index => $val) {
              if ($index > $oldSize - 1) {
                  $old[$index] = $list->getList()[($index - $oldSize)];
              }
          }
  
          return new static($old);
      }
code: public function merge(self $list) : self
      {
          $oldSize = $this->getSize();
          $combinedSize = $oldSize + $list->getSize();
          $old = $this->list;
          $old->setSize($combinedSize);
  
          foreach ($old as $index => $val) {
              if ($index > $oldSize - 1) {
                  $old[$index] = $list->getList()[($index - $oldSize)];
              }
          }
  
          return new static($old);
      }
code_tokens: public function merge ( self $ list ) : self { $ oldSize = $ this -> getSize ( ) ; $ combinedSize = $ oldSize + $ list -> getSize ( ) ; $ old = $ this -> list ; $ old -> setSize ( $ combinedSize ) ; foreach ( $ old as $ index => $ val ) { if ( $ index > $ oldSize - 1 ) { $ old [ $ index ] = $ list -> getList ( ) [ ( $ index - $ oldSize ) ] ; } } return new static ( $ old ) ; }
docstring: merge method.
  
  @method merge
  
  @param Collection $list
  
  @return object Collection
docstring_tokens: merge method .