Code Duplication    Length = 13-15 lines in 2 locations

src/PhpSpreadsheet/Shared/PCLZip/PclZip.php 2 locations

@@ 1698-1712 (lines=15) @@
1695
        }
1696
1697
        // ----- Look for mandatory options
1698
        if ($v_requested_options !== false) {
1699
            for ($key = reset($v_requested_options); $key = key($v_requested_options); $key = next($v_requested_options)) {
1700
                // ----- Look for mandatory option
1701
                if ($v_requested_options[$key] == 'mandatory') {
1702
                    // ----- Look if present
1703
                    if (!isset($v_result_list[$key])) {
1704
                        // ----- Error log
1705
                        self::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, 'Missing mandatory parameter ' . PclZipUtilOptionText($key) . '(' . $key . ')');
1706
1707
                        // ----- Return
1708
                        return self::errorCode();
1709
                    }
1710
                }
1711
            }
1712
        }
1713
1714
        // ----- Look for default values
1715
        if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
@@ 1865-1877 (lines=13) @@
1862
            }
1863
1864
            // ----- Look for mandatory options
1865
            if ($v_requested_options !== false) {
1866
                for ($key = reset($v_requested_options); $key = key($v_requested_options); $key = next($v_requested_options)) {
1867
                    // ----- Look for mandatory option
1868
                    if ($v_requested_options[$key] == 'mandatory') {
1869
                        // ----- Look if present
1870
                        if (!isset($p_file_list[$key])) {
1871
                            self::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, 'Missing mandatory parameter ' . PclZipUtilOptionText($key) . '(' . $key . ')');
1872
1873
                            return self::errorCode();
1874
                        }
1875
                    }
1876
                }
1877
            }
1878
        }
1879
1880
        // ----- Return