Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 59-63 (lines=5) @@
56
        $orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
57
58
        //  Override Page Orientation
59
        if (!is_null($this->getOrientation())) {
60
            $orientation = ($this->getOrientation() == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT)
61
                ? \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT
62
                : $this->getOrientation();
63
        }
64
        //  Override Paper Size
65
        if (!is_null($this->getPaperSize())) {
66
            $printPaperSize = $this->getPaperSize();

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

@@ 59-63 (lines=5) @@
56
        $this->setOrientation($orientation);
57
58
        //  Override Page Orientation
59
        if (null !== $this->getOrientation()) {
60
            $orientation = ($this->getOrientation() == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT)
61
                ? \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT
62
                : $this->getOrientation();
63
        }
64
        $orientation = strtoupper($orientation);
65
66
        //  Override Paper Size