Code Duplication    Length = 11-11 lines in 2 locations

src/PhpSpreadsheet/Writer/Xls/Worksheet.php 1 location

@@ 2802-2812 (lines=11) @@
2799
2800
                // error style
2801
                $errorStyle = $dataValidation->getType();
2802
                switch ($errorStyle) {
2803
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP:
2804
                        $errorStyle = 0x00;
2805
                        break;
2806
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING:
2807
                        $errorStyle = 0x01;
2808
                        break;
2809
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION:
2810
                        $errorStyle = 0x02;
2811
                        break;
2812
                }
2813
                $options |= $errorStyle << 4;
2814
2815
                // explicit formula?

src/PhpSpreadsheet/Reader/Xls.php 1 location

@@ 4659-4669 (lines=11) @@
4656
4657
        // bit: 4-6; mask: 0x00000070; error type
4658
        $errorStyle = (0x00000070 & $options) >> 4;
4659
        switch ($errorStyle) {
4660
            case 0x00:
4661
                $errorStyle = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP;
4662
                break;
4663
            case 0x01:
4664
                $errorStyle = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING;
4665
                break;
4666
            case 0x02:
4667
                $errorStyle = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION;
4668
                break;
4669
        }
4670
4671
        // bit: 7; mask: 0x00000080; 1= formula is explicit (only applies to list)
4672
        // I have only seen cases where this is 1