Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Writer/Ods.php 1 location

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

src/PhpSpreadsheet/Writer/Xlsx.php 1 location

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