Code Duplication    Length = 9-12 lines in 4 locations

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

@@ 942-950 (lines=9) @@
939
    /**
940
     * Write Internal SUPBOOK record
941
     */
942
    private function writeSupbookInternal()
943
    {
944
        $record = 0x01AE; // Record identifier
945
        $length = 0x0004; // Bytes to follow
946
947
        $header = pack('vv', $record, $length);
948
        $data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401);
949
950
        return $this->writeData($header . $data);
951
    }
952
953
    /**
@@ 1219-1229 (lines=11) @@
1216
     *
1217
     * @return string
1218
     */
1219
    private function writeCountry()
1220
    {
1221
        $record = 0x008C; // Record identifier
1222
        $length = 4; // Number of bytes to follow
1223
1224
        $header = pack('vv', $record, $length);
1225
        /* using the same country code always for simplicity */
1226
        $data = pack('vv', $this->countryCode, $this->countryCode);
1227
1228
        return $this->writeData($header . $data);
1229
    }
1230
1231
    /**
1232
     * Write the RECALCID record
@@ 1236-1247 (lines=12) @@
1233
     *
1234
     * @return string
1235
     */
1236
    private function writeRecalcId()
1237
    {
1238
        $record = 0x01C1; // Record identifier
1239
        $length = 8; // Number of bytes to follow
1240
1241
        $header = pack('vv', $record, $length);
1242
1243
        // by inspection of real Excel files, MS Office Excel 2007 writes this
1244
        $data = pack('VV', 0x000001C1, 0x00001E667);
1245
1246
        return $this->writeData($header . $data);
1247
    }
1248
1249
    /**
1250
     * Stores the PALETTE biff record.

src/PhpSpreadsheet/Writer/Excel5/Worksheet.php 1 location

@@ 1628-1636 (lines=9) @@
1625
     *
1626
     * @param int $count The number of external sheet references in this worksheet
1627
     */
1628
    private function writeExterncount($count)
1629
    {
1630
        $record = 0x0016; // Record identifier
1631
        $length = 0x0002; // Number of bytes to follow
1632
1633
        $header = pack('vv', $record, $length);
1634
        $data = pack('v', $count);
1635
        $this->append($header . $data);
1636
    }
1637
1638
    /**
1639
     * Writes the Excel BIFF EXTERNSHEET record. These references are used by