Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Writer/Ods.php 1 location

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

src/PhpSpreadsheet/Writer/Xlsx.php 1 location

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