Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 1017-1027 (lines=11) @@
1014
     * @param string $format Custom format string
1015
     * @param int $ifmt Format index code
1016
     */
1017
    private function writeNumberFormat($format, $ifmt)
1018
    {
1019
        $record = 0x041E; // Record identifier
1020
1021
        $numberFormatString = StringHelper::UTF8toBIFF8UnicodeLong($format);
1022
        $length = 2 + strlen($numberFormatString); // Number of bytes to follow
1023
1024
        $header = pack('vv', $record, $length);
1025
        $data = pack('v', $ifmt) . $numberFormatString;
1026
        $this->append($header . $data);
1027
    }
1028
1029
    /**
1030
     * Write DATEMODE record to indicate the date system in use (1904 or 1900).
@@ 1077-1088 (lines=12) @@
1074
     *
1075
     * @param string $sheetname Worksheet name
1076
     */
1077
    private function writeExternalSheet($sheetname)
1078
    {
1079
        $record = 0x0017; // Record identifier
1080
        $length = 0x02 + strlen($sheetname); // Number of bytes to follow
1081
1082
        $cch = strlen($sheetname); // Length of sheet name
1083
        $rgch = 0x03; // Filename encoding
1084
1085
        $header = pack('vv', $record, $length);
1086
        $data = pack('CC', $cch, $rgch);
1087
        $this->append($header . $data . $sheetname);
1088
    }
1089
1090
    /**
1091
     * Store the NAME record in the short format that is used for storing the print