Code Duplication    Length = 10-20 lines in 3 locations

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

@@ 867-876 (lines=10) @@
864
     *
865
     * @param string $stringValue
866
     */
867
    private function writeStringRecord($stringValue)
868
    {
869
        $record = 0x0207; // Record identifier
870
        $data = StringHelper::UTF8toBIFF8UnicodeLong($stringValue);
871
872
        $length = strlen($data);
873
        $header = pack('vv', $record, $length);
874
875
        $this->append($header . $data);
876
    }
877
878
    /**
879
     * Write a hyperlink.
@@ 1729-1748 (lines=20) @@
1726
    /**
1727
     * Store the header caption BIFF record.
1728
     */
1729
    private function writeHeader()
1730
    {
1731
        $record = 0x0014; // Record identifier
1732
1733
        /* removing for now
1734
        // need to fix character count (multibyte!)
1735
        if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {
1736
            $str      = $this->phpSheet->getHeaderFooter()->getOddHeader();       // header string
1737
        } else {
1738
            $str = '';
1739
        }
1740
        */
1741
1742
        $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());
1743
        $length = strlen($recordData);
1744
1745
        $header = pack('vv', $record, $length);
1746
1747
        $this->append($header . $recordData);
1748
    }
1749
1750
    /**
1751
     * Store the footer caption BIFF record.
@@ 1753-1772 (lines=20) @@
1750
    /**
1751
     * Store the footer caption BIFF record.
1752
     */
1753
    private function writeFooter()
1754
    {
1755
        $record = 0x0015; // Record identifier
1756
1757
        /* removing for now
1758
        // need to fix character count (multibyte!)
1759
        if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) {
1760
            $str = $this->phpSheet->getHeaderFooter()->getOddFooter();
1761
        } else {
1762
            $str = '';
1763
        }
1764
        */
1765
1766
        $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter());
1767
        $length = strlen($recordData);
1768
1769
        $header = pack('vv', $record, $length);
1770
1771
        $this->append($header . $recordData);
1772
    }
1773
1774
    /**
1775
     * Store the horizontal centering HCENTER BIFF record.