Code Duplication    Length = 11-11 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 1 location

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

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

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