Code Duplication    Length = 11-11 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 1 location

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

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

@@ 2846-2856 (lines=11) @@
2843
2844
                // error style
2845
                $errorStyle = $dataValidation->getType();
2846
                switch ($errorStyle) {
2847
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP:
2848
                        $errorStyle = 0x00;
2849
                        break;
2850
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING:
2851
                        $errorStyle = 0x01;
2852
                        break;
2853
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION:
2854
                        $errorStyle = 0x02;
2855
                        break;
2856
                }
2857
2858
                $errorStyle = (int) $errorStyle;
2859
                $options |= $errorStyle << 4;