code: protected function adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
      {
          $aRowDimensions = array_reverse($pSheet->getRowDimensions(), true);
          if (!empty($aRowDimensions)) {
              foreach ($aRowDimensions as $objRowDimension) {
                  $newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
                  list(, $newReference) = Coordinate::coordinateFromString($newReference);
                  if ($objRowDimension->getRowIndex() != $newReference) {
                      $objRowDimension->setRowIndex($newReference);
                  }
              }
              $pSheet->refreshRowDimensions();
  
              $copyDimension = $pSheet->getRowDimension($beforeRow - 1);
              for ($i = $beforeRow; $i <= $beforeRow - 1 + $pNumRows; ++$i) {
                  $newDimension = $pSheet->getRowDimension($i);
                  $newDimension->setRowHeight($copyDimension->getRowHeight());
                  $newDimension->setVisible($copyDimension->getVisible());
                  $newDimension->setOutlineLevel($copyDimension->getOutlineLevel());
                  $newDimension->setCollapsed($copyDimension->getCollapsed());
              }
          }
      }
docs: Update row dimensions when inserting/deleting rows/columns.
  
  @param Worksheet $pSheet The worksheet that we're editing
  @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
  @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
  @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
  @param int $beforeRow Number of the row we're inserting/deleting before
  @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)