Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Writer/OpenDocument.php 1 location

@@ 101-106 (lines=6) @@
98
99
        // If $pFilename is php://output or php://stdout, make it a temporary file...
100
        $originalFilename = $pFilename;
101
        if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
102
            $pFilename = @tempnam(\PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp');
103
            if ($pFilename == '') {
104
                $pFilename = $originalFilename;
105
            }
106
        }
107
108
        $objZip = $this->createZip($pFilename);
109

src/PhpSpreadsheet/Writer/Xlsx.php 1 location

@@ 180-185 (lines=6) @@
177
178
            // If $pFilename is php://output or php://stdout, make it a temporary file...
179
            $originalFilename = $pFilename;
180
            if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
181
                $pFilename = @tempnam(\PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp');
182
                if ($pFilename == '') {
183
                    $pFilename = $originalFilename;
184
                }
185
            }
186
187
            $saveDebugLog = \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog();
188
            \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false);