Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 26-34 (lines=9) @@
23
        $paperSize = 'LETTER'; //    Letter    (8.5 in. by 11 in.)
24
25
        //  Check for paper size and page orientation
26
        if ($this->getSheetIndex() === null) {
27
            $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
28
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
29
            $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
30
        } else {
31
            $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
32
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
33
            $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
34
        }
35
36
        $orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
37

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

@@ 28-36 (lines=9) @@
25
        $paperSize = 'LETTER'; //    Letter    (8.5 in. by 11 in.)
26
27
        //  Check for paper size and page orientation
28
        if (null === $this->getSheetIndex()) {
29
            $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
30
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
31
            $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
32
        } else {
33
            $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
34
                == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
35
            $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
36
        }
37
        $this->setOrientation($orientation);
38
39
        //  Override Page Orientation