Code Duplication    Length = 7-8 lines in 2 locations

src/PhpSpreadsheet/Style/Style.php 2 locations

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