Code Duplication    Length = 5-5 lines in 3 locations

src/PhpSpreadsheet/Shared/File.php 3 locations

@@ 148-152 (lines=5) @@
145
        // sys_get_temp_dir is only available since PHP 5.2.1
146
        // http://php.net/manual/en/function.sys-get-temp-dir.php#94119
147
        if (!function_exists('sys_get_temp_dir')) {
148
            if ($temp = getenv('TMP')) {
149
                if ((!empty($temp)) && (file_exists($temp))) {
150
                    return realpath($temp);
151
                }
152
            }
153
            if ($temp = getenv('TEMP')) {
154
                if ((!empty($temp)) && (file_exists($temp))) {
155
                    return realpath($temp);
@@ 153-157 (lines=5) @@
150
                    return realpath($temp);
151
                }
152
            }
153
            if ($temp = getenv('TEMP')) {
154
                if ((!empty($temp)) && (file_exists($temp))) {
155
                    return realpath($temp);
156
                }
157
            }
158
            if ($temp = getenv('TMPDIR')) {
159
                if ((!empty($temp)) && (file_exists($temp))) {
160
                    return realpath($temp);
@@ 158-162 (lines=5) @@
155
                    return realpath($temp);
156
                }
157
            }
158
            if ($temp = getenv('TMPDIR')) {
159
                if ((!empty($temp)) && (file_exists($temp))) {
160
                    return realpath($temp);
161
                }
162
            }
163
164
            // trick for creating a file in system's temporary dir
165
            // without knowing the path of the system's temporary dir