Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Writer/Excel2007.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(\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp');
182
                if ($pFilename == '') {
183
                    $pFilename = $originalFilename;
184
                }
185
            }
186
187
            $saveDebugLog = \PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog();
188
            \PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false);

src/PhpSpreadsheet/Writer/OpenDocument.php 1 location

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