Code Duplication    Length = 11-11 lines in 5 locations

src/PhpSpreadsheet/Writer/Xls/Workbook.php 1 location

@@ 760-770 (lines=11) @@
757
    /**
758
     * Stores the CODEPAGE biff record.
759
     */
760
    private function writeCodepage()
761
    {
762
        $record = 0x0042; // Record identifier
763
        $length = 0x0002; // Number of bytes to follow
764
        $cv = $this->codepage; // The code page
765
766
        $header = pack('vv', $record, $length);
767
        $data = pack('v', $cv);
768
769
        $this->append($header . $data);
770
    }
771
772
    /**
773
     * Write Excel BIFF WINDOW1 record.

src/PhpSpreadsheet/Writer/Xls/Worksheet.php 4 locations

@@ 735-745 (lines=11) @@
732
     * @param int $col Zero indexed column
733
     * @param mixed $xfIndex The XF format index
734
     */
735
    public function writeBlank($row, $col, $xfIndex)
736
    {
737
        $record = 0x0201; // Record identifier
738
        $length = 0x0006; // Number of bytes to follow
739
740
        $header = pack('vv', $record, $length);
741
        $data = pack('vvv', $row, $col, $xfIndex);
742
        $this->append($header . $data);
743
744
        return 0;
745
    }
746
747
    /**
748
     * Write a boolean or an error type to the specified row and column (zero indexed).
@@ 756-766 (lines=11) @@
753
     * @param bool $isError Error or Boolean?
754
     * @param int $xfIndex
755
     */
756
    private function writeBoolErr($row, $col, $value, $isError, $xfIndex)
757
    {
758
        $record = 0x0205;
759
        $length = 8;
760
761
        $header = pack('vv', $record, $length);
762
        $data = pack('vvvCC', $row, $col, $xfIndex, $value, $isError);
763
        $this->append($header . $data);
764
765
        return 0;
766
    }
767
768
    /**
769
     * Write a formula to the specified row and column (zero indexed).
@@ 1280-1290 (lines=11) @@
1277
    /**
1278
     * Write BIFF record DEFCOLWIDTH if COLINFO records are in use.
1279
     */
1280
    private function writeDefcol()
1281
    {
1282
        $defaultColWidth = 8;
1283
1284
        $record = 0x0055; // Record identifier
1285
        $length = 0x0002; // Number of bytes to follow
1286
1287
        $header = pack('vv', $record, $length);
1288
        $data = pack('v', $defaultColWidth);
1289
        $this->append($header . $data);
1290
    }
1291
1292
    /**
1293
     * Write BIFF record COLINFO to define column widths.
@@ 1889-1899 (lines=11) @@
1886
    /**
1887
     * Write the PRINTHEADERS BIFF record.
1888
     */
1889
    private function writePrintHeaders()
1890
    {
1891
        $record = 0x002a; // Record identifier
1892
        $length = 0x0002; // Bytes to follow
1893
1894
        $fPrintRwCol = $this->printHeaders; // Boolean flag
1895
1896
        $header = pack('vv', $record, $length);
1897
        $data = pack('v', $fPrintRwCol);
1898
        $this->append($header . $data);
1899
    }
1900
1901
    /**
1902
     * Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the