Code Duplication    Length = 9-12 lines in 3 locations

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

@@ 849-857 (lines=9) @@
846
    /**
847
     * Write Internal SUPBOOK record.
848
     */
849
    private function writeSupbookInternal()
850
    {
851
        $record = 0x01AE; // Record identifier
852
        $length = 0x0004; // Bytes to follow
853
854
        $header = pack('vv', $record, $length);
855
        $data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401);
856
857
        return $this->writeData($header . $data);
858
    }
859
860
    /**
@@ 937-947 (lines=11) @@
934
     *
935
     * @return string
936
     */
937
    private function writeCountry()
938
    {
939
        $record = 0x008C; // Record identifier
940
        $length = 4; // Number of bytes to follow
941
942
        $header = pack('vv', $record, $length);
943
        // using the same country code always for simplicity
944
        $data = pack('vv', $this->countryCode, $this->countryCode);
945
946
        return $this->writeData($header . $data);
947
    }
948
949
    /**
950
     * Write the RECALCID record.
@@ 954-965 (lines=12) @@
951
     *
952
     * @return string
953
     */
954
    private function writeRecalcId()
955
    {
956
        $record = 0x01C1; // Record identifier
957
        $length = 8; // Number of bytes to follow
958
959
        $header = pack('vv', $record, $length);
960
961
        // by inspection of real Excel files, MS Office Excel 2007 writes this
962
        $data = pack('VV', 0x000001C1, 0x00001E667);
963
964
        return $this->writeData($header . $data);
965
    }
966
967
    /**
968
     * Stores the PALETTE biff record.