Code Duplication    Length = 7-8 lines in 2 locations

src/PhpSpreadsheet/Style.php 2 locations

@@ 413-419 (lines=7) @@
410
411
                // Loop through columns, rows, or cells again and update the XF index
412
                switch ($selectionType) {
413
                    case 'COLUMN':
414
                        for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
415
                            $columnDimension = $this->getActiveSheet()->getColumnDimensionByColumn($col);
416
                            $oldXfIndex = $columnDimension->getXfIndex();
417
                            $columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
418
                        }
419
                        break;
420
421
                    case 'ROW':
422
                        for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
@@ 421-428 (lines=8) @@
418
                        }
419
                        break;
420
421
                    case 'ROW':
422
                        for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
423
                            $rowDimension = $this->getActiveSheet()->getRowDimension($row);
424
                            $oldXfIndex = $rowDimension->getXfIndex() === null ?
425
                                0 : $rowDimension->getXfIndex(); // row without explicit style should be formatted based on default style
426
                            $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
427
                        }
428
                        break;
429
430
                    case 'CELL':
431
                        for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {