Code Duplication    Length = 10-20 lines in 3 locations

src/PhpSpreadsheet/Writer/Xls/Worksheet.php 3 locations

@@ 952-961 (lines=10) @@
949
     *
950
     * @param string $stringValue
951
     */
952
    private function writeStringRecord($stringValue)
953
    {
954
        $record = 0x0207; // Record identifier
955
        $data = StringHelper::UTF8toBIFF8UnicodeLong($stringValue);
956
957
        $length = strlen($data);
958
        $header = pack('vv', $record, $length);
959
960
        $this->append($header . $data);
961
    }
962
963
    /**
964
     * Write a hyperlink.
@@ 1867-1886 (lines=20) @@
1864
    /**
1865
     * Store the header caption BIFF record.
1866
     */
1867
    private function writeHeader()
1868
    {
1869
        $record = 0x0014; // Record identifier
1870
1871
        /* removing for now
1872
        // need to fix character count (multibyte!)
1873
        if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {
1874
            $str      = $this->phpSheet->getHeaderFooter()->getOddHeader();       // header string
1875
        } else {
1876
            $str = '';
1877
        }
1878
        */
1879
1880
        $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());
1881
        $length = strlen($recordData);
1882
1883
        $header = pack('vv', $record, $length);
1884
1885
        $this->append($header . $recordData);
1886
    }
1887
1888
    /**
1889
     * Store the footer caption BIFF record.
@@ 1891-1910 (lines=20) @@
1888
    /**
1889
     * Store the footer caption BIFF record.
1890
     */
1891
    private function writeFooter()
1892
    {
1893
        $record = 0x0015; // Record identifier
1894
1895
        /* removing for now
1896
        // need to fix character count (multibyte!)
1897
        if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) {
1898
            $str = $this->phpSheet->getHeaderFooter()->getOddFooter();
1899
        } else {
1900
            $str = '';
1901
        }
1902
        */
1903
1904
        $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter());
1905
        $length = strlen($recordData);
1906
1907
        $header = pack('vv', $record, $length);
1908
1909
        $this->append($header . $recordData);
1910
    }
1911
1912
    /**
1913
     * Store the horizontal centering HCENTER BIFF record.