Code Duplication    Length = 9-9 lines in 2 locations

src/PhpSpreadsheet/Writer/Pdf/Dompdf.php 1 location

@@ 35-43 (lines=9) @@
32
        $paperSize = 'LETTER'; //    Letter    (8.5 in. by 11 in.)
33
34
        //  Check for paper size and page orientation
35
        if ($this->getSheetIndex() === null) {
36
            $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
37
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
38
            $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
39
        } else {
40
            $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
41
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
42
            $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
43
        }
44
45
        $orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
46

src/PhpSpreadsheet/Writer/Pdf/Mpdf.php 1 location

@@ 39-47 (lines=9) @@
36
        $paperSize = 'LETTER'; //    Letter    (8.5 in. by 11 in.)
37
38
        //  Check for paper size and page orientation
39
        if (null === $this->getSheetIndex()) {
40
            $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
41
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
42
            $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
43
        } else {
44
            $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
45
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
46
            $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
47
        }
48
        $this->setOrientation($orientation);
49
50
        //  Override Page Orientation