Code Duplication    Length = 10-20 lines in 3 locations

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

@@ 909-918 (lines=10) @@
906
     *
907
     * @param string $stringValue
908
     */
909
    private function writeStringRecord($stringValue)
910
    {
911
        $record = 0x0207; // Record identifier
912
        $data = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue);
913
914
        $length = strlen($data);
915
        $header = pack('vv', $record, $length);
916
917
        $this->append($header . $data);
918
    }
919
920
    /**
921
     * Write a hyperlink.
@@ 1816-1835 (lines=20) @@
1813
    /**
1814
     * Store the header caption BIFF record.
1815
     */
1816
    private function writeHeader()
1817
    {
1818
        $record = 0x0014; // Record identifier
1819
1820
        /* removing for now
1821
        // need to fix character count (multibyte!)
1822
        if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {
1823
            $str      = $this->phpSheet->getHeaderFooter()->getOddHeader();       // header string
1824
        } else {
1825
            $str = '';
1826
        }
1827
        */
1828
1829
        $recordData = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());
1830
        $length = strlen($recordData);
1831
1832
        $header = pack('vv', $record, $length);
1833
1834
        $this->append($header . $recordData);
1835
    }
1836
1837
    /**
1838
     * Store the footer caption BIFF record.
@@ 1840-1859 (lines=20) @@
1837
    /**
1838
     * Store the footer caption BIFF record.
1839
     */
1840
    private function writeFooter()
1841
    {
1842
        $record = 0x0015; // Record identifier
1843
1844
        /* removing for now
1845
        // need to fix character count (multibyte!)
1846
        if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) {
1847
            $str = $this->phpSheet->getHeaderFooter()->getOddFooter();
1848
        } else {
1849
            $str = '';
1850
        }
1851
        */
1852
1853
        $recordData = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter());
1854
        $length = strlen($recordData);
1855
1856
        $header = pack('vv', $record, $length);
1857
1858
        $this->append($header . $recordData);
1859
    }
1860
1861
    /**
1862
     * Store the horizontal centering HCENTER BIFF record.