Code Duplication    Length = 11-17 lines in 4 locations

src/PhpSpreadsheet/Writer/Excel5/Worksheet.php 4 locations

@@ 1863-1874 (lines=12) @@
1860
    /**
1861
     * Store the horizontal centering HCENTER BIFF record.
1862
     */
1863
    private function writeHcenter()
1864
    {
1865
        $record = 0x0083; // Record identifier
1866
        $length = 0x0002; // Bytes to follow
1867
1868
        $fHCenter = $this->phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering
1869
1870
        $header = pack('vv', $record, $length);
1871
        $data = pack('v', $fHCenter);
1872
1873
        $this->append($header . $data);
1874
    }
1875
1876
    /**
1877
     * Store the vertical centering VCENTER BIFF record.
@@ 1879-1889 (lines=11) @@
1876
    /**
1877
     * Store the vertical centering VCENTER BIFF record.
1878
     */
1879
    private function writeVcenter()
1880
    {
1881
        $record = 0x0084; // Record identifier
1882
        $length = 0x0002; // Bytes to follow
1883
1884
        $fVCenter = $this->phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering
1885
1886
        $header = pack('vv', $record, $length);
1887
        $data = pack('v', $fVCenter);
1888
        $this->append($header . $data);
1889
    }
1890
1891
    /**
1892
     * Store the LEFTMARGIN BIFF record.
@@ 1986-1996 (lines=11) @@
1983
     * Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the
1984
     * GRIDSET record.
1985
     */
1986
    private function writePrintGridlines()
1987
    {
1988
        $record = 0x002b; // Record identifier
1989
        $length = 0x0002; // Bytes to follow
1990
1991
        $fPrintGrid = $this->phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag
1992
1993
        $header = pack('vv', $record, $length);
1994
        $data = pack('v', $fPrintGrid);
1995
        $this->append($header . $data);
1996
    }
1997
1998
    /**
1999
     * Write the GRIDSET BIFF record. Must be used in conjunction with the
@@ 2197-2213 (lines=17) @@
2194
    /**
2195
     * Set the Biff PROTECT record to indicate that the worksheet is protected.
2196
     */
2197
    private function writeProtect()
2198
    {
2199
        // Exit unless sheet protection has been specified
2200
        if (!$this->phpSheet->getProtection()->getSheet()) {
2201
            return;
2202
        }
2203
2204
        $record = 0x0012; // Record identifier
2205
        $length = 0x0002; // Bytes to follow
2206
2207
        $fLock = 1; // Worksheet is protected
2208
2209
        $header = pack('vv', $record, $length);
2210
        $data = pack('v', $fLock);
2211
2212
        $this->append($header . $data);
2213
    }
2214
2215
    /**
2216
     * Write SCENPROTECT