Code Duplication    Length = 16-17 lines in 2 locations

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

@@ 673-688 (lines=16) @@
670
     * @param int $xfIndex The XF format index for the cell
671
     * @param array $arrcRun Index to Font record and characters beginning
672
     */
673
    private function writeRichTextString($row, $col, $str, $xfIndex, $arrcRun)
674
    {
675
        $record = 0x00FD; // Record identifier
676
        $length = 0x000A; // Bytes to follow
677
        $str = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun);
678
679
        /* check if string is already present */
680
        if (!isset($this->stringTable[$str])) {
681
            $this->stringTable[$str] = $this->stringUnique++;
682
        }
683
        ++$this->stringTotal;
684
685
        $header = pack('vv', $record, $length);
686
        $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]);
687
        $this->append($header . $data);
688
    }
689
690
    /**
691
     * Write a string to the specified row and column (zero indexed).
@@ 742-758 (lines=17) @@
739
     *
740
     * @return int
741
     */
742
    private function writeLabelSst($row, $col, $str, $xfIndex)
743
    {
744
        $record = 0x00FD; // Record identifier
745
        $length = 0x000A; // Bytes to follow
746
747
        $str = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str);
748
749
        /* check if string is already present */
750
        if (!isset($this->stringTable[$str])) {
751
            $this->stringTable[$str] = $this->stringUnique++;
752
        }
753
        ++$this->stringTotal;
754
755
        $header = pack('vv', $record, $length);
756
        $data = pack('vvvV', $row, $col, $xfIndex, $this->stringTable[$str]);
757
        $this->append($header . $data);
758
    }
759
760
    /**
761
     * Writes a note associated with the cell given by the row and column.