Code Duplication    Length = 24-29 lines in 2 locations

app/Vendor/PHPExcel/PHPExcel/Shared/PCLZip/pclzip.lib.php 2 locations

@@ 1566-1589 (lines=24) @@
1563
          // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
1564
          // to PCLZIP_OPT_BY_PREG
1565
          $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
1566
        case PCLZIP_OPT_BY_PREG :
1567
        //case PCLZIP_OPT_CRYPT :
1568
          // ----- Check the number of parameters
1569
          if (($i+1) >= $p_size) {
1570
            // ----- Error log
1571
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1572
1573
            // ----- Return
1574
            return PclZip::errorCode();
1575
          }
1576
1577
          // ----- Get the value
1578
          if (is_string($p_options_list[$i+1])) {
1579
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1580
          }
1581
          else {
1582
            // ----- Error log
1583
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1584
1585
            // ----- Return
1586
            return PclZip::errorCode();
1587
          }
1588
          $i++;
1589
        break;
1590
1591
        // ----- Look for options that takes a string
1592
        case PCLZIP_OPT_COMMENT :
@@ 1594-1622 (lines=29) @@
1591
        // ----- Look for options that takes a string
1592
        case PCLZIP_OPT_COMMENT :
1593
        case PCLZIP_OPT_ADD_COMMENT :
1594
        case PCLZIP_OPT_PREPEND_COMMENT :
1595
          // ----- Check the number of parameters
1596
          if (($i+1) >= $p_size) {
1597
            // ----- Error log
1598
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,
1599
			                     "Missing parameter value for option '"
1600
								 .PclZipUtilOptionText($p_options_list[$i])
1601
								 ."'");
1602
1603
            // ----- Return
1604
            return PclZip::errorCode();
1605
          }
1606
1607
          // ----- Get the value
1608
          if (is_string($p_options_list[$i+1])) {
1609
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1610
          }
1611
          else {
1612
            // ----- Error log
1613
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
1614
			                     "Wrong parameter value for option '"
1615
								 .PclZipUtilOptionText($p_options_list[$i])
1616
								 ."'");
1617
1618
            // ----- Return
1619
            return PclZip::errorCode();
1620
          }
1621
          $i++;
1622
        break;
1623
1624
        // ----- Look for options that request an array of index
1625
        case PCLZIP_OPT_BY_INDEX :