Sheet::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
namespace Xls\Record;
3
4
use Xls\StringUtils;
5
use Xls\Worksheet;
6
7
class Sheet extends AbstractRecord
8
{
9
    const NAME = 'SHEET';
10
    const ID = 0x0085;
11
12
    /**
13
     * Generate BOUNDSHEET record.
14
     *
15
     * @param string $sheetName Worksheet name
16
     * @param integer $offset Location of worksheet BOF
17
     * @return string
18
     */
19
    public function getData($sheetName, $offset = 0)
20
    {
21
        $sheetState = Worksheet::STATE_VISIBLE;
22
        $sheetType = Worksheet::TYPE_SHEET;
23
24
        $data = pack("VCC", $offset, $sheetState, $sheetType);
25
        $data .= StringUtils::toBiff8UnicodeShort($sheetName);
26
27
        return $this->getFullRecord($data);
28
    }
29
}
30