Bof::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
c 5
b 0
f 0
dl 11
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
namespace Xls\Record;
3
4
use Xls\Biff8;
5
6 View Code Duplication
class Bof extends AbstractRecord
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
7
{
8
    const NAME = 'BOF';
9
    const ID = 0x0809;
10
11
    /**
12
     * Generate BOF record to indicate the beginning of a stream or
13
     * sub-stream in the BIFF file.
14
     *
15
     * @param integer $type Type of BIFF file to write: Workbook or Worksheet.
16
     * @return string
17
     */
18
    public function getData($type)
19
    {
20
        $build = 0x0DBB;
21
        $year = 0x07CC;
22
23
        $data = pack("vvvv", Biff8::VERSION, $type, $build, $year);
24
        $unknown = pack("VV", 0x000100D1, 0x00000406);
25
        $data .= $unknown;
26
27
        return $this->getFullRecord($data);
28
    }
29
}
30