Code Duplication    Length = 11-12 lines in 2 locations

src/PhpSpreadsheet/Writer/Excel5/Workbook.php 2 locations

@@ 1056-1067 (lines=12) @@
1053
     *
1054
     * @param string $sheetname Worksheet name
1055
     */
1056
    private function writeExternalSheet($sheetname)
1057
    {
1058
        $record = 0x0017; // Record identifier
1059
        $length = 0x02 + strlen($sheetname); // Number of bytes to follow
1060
1061
        $cch = strlen($sheetname); // Length of sheet name
1062
        $rgch = 0x03; // Filename encoding
1063
1064
        $header = pack('vv', $record, $length);
1065
        $data = pack('CC', $cch, $rgch);
1066
        $this->append($header . $data . $sheetname);
1067
    }
1068
1069
    /**
1070
     * Store the NAME record in the short format that is used for storing the print
@@ 996-1006 (lines=11) @@
993
     * @param string  $format Custom format string
994
     * @param int $ifmt   Format index code
995
     */
996
    private function writeNumberFormat($format, $ifmt)
997
    {
998
        $record = 0x041E; // Record identifier
999
1000
        $numberFormatString = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format);
1001
        $length = 2 + strlen($numberFormatString); // Number of bytes to follow
1002
1003
        $header = pack('vv', $record, $length);
1004
        $data = pack('v', $ifmt) . $numberFormatString;
1005
        $this->append($header . $data);
1006
    }
1007
1008
    /**
1009
     * Write DATEMODE record to indicate the date system in use (1904 or 1900).