Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 1005-1015 (lines=11) @@
1002
     * @param string $format Custom format string
1003
     * @param int $ifmt Format index code
1004
     */
1005
    private function writeNumberFormat($format, $ifmt)
1006
    {
1007
        $record = 0x041E; // Record identifier
1008
1009
        $numberFormatString = StringHelper::UTF8toBIFF8UnicodeLong($format);
1010
        $length = 2 + strlen($numberFormatString); // Number of bytes to follow
1011
1012
        $header = pack('vv', $record, $length);
1013
        $data = pack('v', $ifmt) . $numberFormatString;
1014
        $this->append($header . $data);
1015
    }
1016
1017
    /**
1018
     * Write DATEMODE record to indicate the date system in use (1904 or 1900).
@@ 1065-1076 (lines=12) @@
1062
     *
1063
     * @param string $sheetname Worksheet name
1064
     */
1065
    private function writeExternalSheet($sheetname)
1066
    {
1067
        $record = 0x0017; // Record identifier
1068
        $length = 0x02 + strlen($sheetname); // Number of bytes to follow
1069
1070
        $cch = strlen($sheetname); // Length of sheet name
1071
        $rgch = 0x03; // Filename encoding
1072
1073
        $header = pack('vv', $record, $length);
1074
        $data = pack('CC', $cch, $rgch);
1075
        $this->append($header . $data . $sheetname);
1076
    }
1077
1078
    /**
1079
     * Store the NAME record in the short format that is used for storing the print