Code Duplication    Length = 9-12 lines in 4 locations

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

@@ 949-957 (lines=9) @@
946
    /**
947
     * Write Internal SUPBOOK record
948
     */
949
    private function writeSupbookInternal()
950
    {
951
        $record    = 0x01AE;   // Record identifier
952
        $length    = 0x0004;   // Bytes to follow
953
954
        $header    = pack("vv", $record, $length);
955
        $data      = pack("vv", $this->spreadsheet->getSheetCount(), 0x0401);
956
        return $this->writeData($header . $data);
957
    }
958
959
    /**
960
     * Writes the Excel BIFF EXTERNSHEET record. These references are used by
@@ 1226-1236 (lines=11) @@
1223
     *
1224
     * @return string
1225
     */
1226
    private function writeCountry()
1227
    {
1228
        $record = 0x008C;    // Record identifier
1229
        $length = 4;         // Number of bytes to follow
1230
1231
        $header = pack('vv', $record, $length);
1232
        /* using the same country code always for simplicity */
1233
        $data = pack('vv', $this->countryCode, $this->countryCode);
1234
        //$this->append($header . $data);
1235
        return $this->writeData($header . $data);
1236
    }
1237
1238
    /**
1239
     * Write the RECALCID record
@@ 1243-1254 (lines=12) @@
1240
     *
1241
     * @return string
1242
     */
1243
    private function writeRecalcId()
1244
    {
1245
        $record = 0x01C1;    // Record identifier
1246
        $length = 8;         // Number of bytes to follow
1247
1248
        $header = pack('vv', $record, $length);
1249
1250
        // by inspection of real Excel files, MS Office Excel 2007 writes this
1251
        $data = pack('VV', 0x000001C1, 0x00001E667);
1252
1253
        return $this->writeData($header . $data);
1254
    }
1255
1256
    /**
1257
     * Stores the PALETTE biff record.

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

@@ 1641-1649 (lines=9) @@
1638
     *
1639
     * @param integer $count The number of external sheet references in this worksheet
1640
     */
1641
    private function writeExterncount($count)
1642
    {
1643
        $record = 0x0016;          // Record identifier
1644
        $length = 0x0002;          // Number of bytes to follow
1645
1646
        $header = pack("vv", $record, $length);
1647
        $data   = pack("v", $count);
1648
        $this->append($header . $data);
1649
    }
1650
1651
    /**
1652
     * Writes the Excel BIFF EXTERNSHEET record. These references are used by