Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 1497-1517 (lines=21) @@
1494
                    // to PCLZIP_OPT_BY_PREG
1495
                    $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
1496
                    // no break;
1497
                case PCLZIP_OPT_BY_PREG:
1498
                //case PCLZIP_OPT_CRYPT :
1499
                    // ----- Check the number of parameters
1500
                    if (($i + 1) >= $p_size) {
1501
                        // ----- Error log
1502
                        self::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '" . PclZipUtilOptionText($p_options_list[$i]) . "'");
1503
                        // ----- Return
1504
                        return self::errorCode();
1505
                    }
1506
1507
                    // ----- Get the value
1508
                    if (is_string($p_options_list[$i + 1])) {
1509
                        $v_result_list[$p_options_list[$i]] = $p_options_list[$i + 1];
1510
                    } else {
1511
                        // ----- Error log
1512
                        self::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '" . PclZipUtilOptionText($p_options_list[$i]) . "'");
1513
                        // ----- Return
1514
                        return self::errorCode();
1515
                    }
1516
                    ++$i;
1517
                    break;
1518
1519
                // ----- Look for options that takes a string
1520
                case PCLZIP_OPT_COMMENT:
@@ 1522-1543 (lines=22) @@
1519
                // ----- Look for options that takes a string
1520
                case PCLZIP_OPT_COMMENT:
1521
                case PCLZIP_OPT_ADD_COMMENT:
1522
                case PCLZIP_OPT_PREPEND_COMMENT:
1523
                    // ----- Check the number of parameters
1524
                    if (($i + 1) >= $p_size) {
1525
                        // ----- Error log
1526
                        self::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '" . PclZipUtilOptionText($p_options_list[$i]) . "'");
1527
1528
                        // ----- Return
1529
                        return self::errorCode();
1530
                    }
1531
1532
                    // ----- Get the value
1533
                    if (is_string($p_options_list[$i + 1])) {
1534
                        $v_result_list[$p_options_list[$i]] = $p_options_list[$i + 1];
1535
                    } else {
1536
                        // ----- Error log
1537
                        self::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '" . PclZipUtilOptionText($p_options_list[$i]) . "'");
1538
1539
                        // ----- Return
1540
                        return self::errorCode();
1541
                    }
1542
                    ++$i;
1543
                    break;
1544
1545
                // ----- Look for options that request an array of index
1546
                case PCLZIP_OPT_BY_INDEX: