Code Duplication    Length = 4-9 lines in 5 locations

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

@@ 2667-2670 (lines=4) @@
2664
        else {
2665
2666
        // ----- Open the source file
2667
        if (($v_file = @fopen($p_filename, "rb")) == 0) {
2668
          PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
2669
          return PclZip::errorCode();
2670
        }
2671
2672
        // ----- Read the file content
2673
        $v_content = @fread($v_file, $p_header['size']);
@@ 2807-2810 (lines=4) @@
2804
2805
2806
    // ----- Open the source file
2807
    if (($v_file = @fopen($p_filename, "rb")) == 0) {
2808
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
2809
      return PclZip::errorCode();
2810
    }
2811
2812
    // ----- Creates a compressed temporary file
2813
    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
@@ 2841-2844 (lines=4) @@
2838
    }
2839
2840
    // ----- Extract the compressed attributes
2841
    if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) {
2842
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
2843
      return PclZip::errorCode();
2844
    }
2845
2846
    // ----- Read the gzip file header
2847
    $v_binary_data = @fread($v_file_compressed, 10);
@@ 2873-2877 (lines=5) @@
2870
    }
2871
2872
    // ----- Add the compressed data
2873
    if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0)
2874
    {
2875
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
2876
      return PclZip::errorCode();
2877
    }
2878
2879
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
2880
    fseek($v_file_compressed, 10);
@@ 5255-5263 (lines=9) @@
5252
    }
5253
5254
    // ----- Open the temporary file in write mode
5255
    if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
5256
    {
5257
      $this->privCloseFd();
5258
5259
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');
5260
5261
      // ----- Return
5262
      return PclZip::errorCode();
5263
    }
5264
5265
    // ----- Copy the files from the archive to the temporary file
5266
    // TBC : Here I should better append the file and go back to erase the central dir