Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 2812-2822 (lines=11) @@
2809
2810
                // error style
2811
                $errorStyle = $dataValidation->getType();
2812
                switch ($errorStyle) {
2813
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP:
2814
                        $errorStyle = 0x00;
2815
                        break;
2816
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING:
2817
                        $errorStyle = 0x01;
2818
                        break;
2819
                    case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION:
2820
                        $errorStyle = 0x02;
2821
                        break;
2822
                }
2823
                $options |= $errorStyle << 4;
2824
2825
                // explicit formula?

src/PhpSpreadsheet/Reader/Xls.php 1 location

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