Code Duplication    Length = 6-7 lines in 3 locations

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

@@ 2651-2656 (lines=6) @@
2648
2649
        // ----- Creates a compressed temporary file
2650
        $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.gz';
2651
        if (($v_file_compressed = @gzopen($v_gzip_temp_name, 'wb')) == 0) {
2652
            fclose($v_file);
2653
            self::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \'' . $v_gzip_temp_name . '\' in binary write mode');
2654
2655
            return self::errorCode();
2656
        }
2657
2658
        // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
2659
        $v_size = filesize($p_filename);
@@ 3639-3644 (lines=6) @@
3636
3637
        // ----- Creates a temporary file
3638
        $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.gz';
3639
        if (($v_dest_file = @fopen($v_gzip_temp_name, 'wb')) == 0) {
3640
            fclose($v_file);
3641
            self::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \'' . $v_gzip_temp_name . '\' in binary write mode');
3642
3643
            return self::errorCode();
3644
        }
3645
3646
        // ----- Write gz file format header
3647
        $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));
@@ 3675-3681 (lines=7) @@
3672
        }
3673
3674
        // ----- Open the temporary gz file
3675
        if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {
3676
            @fclose($v_dest_file);
3677
            $p_entry['status'] = 'read_error';
3678
            self::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \'' . $v_gzip_temp_name . '\' in binary read mode');
3679
3680
            return self::errorCode();
3681
        }
3682
3683
        // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
3684
        $v_size = $p_entry['size'];