WsBool   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 6
c 3
b 0
f 0
lcom 0
cbo 3
dl 0
loc 38
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getData() 0 26 6
1
<?php
2
namespace Xls\Record;
3
4
use Xls\Worksheet;
5
6
class WsBool extends AbstractRecord
7
{
8
    const NAME = 'WSBOOL';
9
    const ID = 0x0081;
10
11
    /**
12
     * Generate the WSBOOL biff record
13
     * @param Worksheet $sheet
14
     *
15
     * @return string
16
     */
17
    public function getData(Worksheet $sheet)
18
    {
19
        $grbit = 0x0000;
20
21
        // Set the option flags
22
        $grbit |= 0x0001; // Auto page breaks visible
23
        if ($sheet->getOutlineStyle()) {
24
            $grbit |= 0x0020; // Auto outline styles
25
        }
26
        if ($sheet->getOutlineBelow()) {
27
            $grbit |= 0x0040; // Outline summary below
28
        }
29
        if ($sheet->getOutlineRight()) {
30
            $grbit |= 0x0080; // Outline summary right
31
        }
32
        if ($sheet->getPrintSetup()->isFitPage()) {
33
            $grbit |= 0x0100; // Page setup fit to page
34
        }
35
        if ($sheet->isOutlineOn()) {
36
            $grbit |= 0x0400; // Outline symbols displayed
37
        }
38
39
        $data = pack("v", $grbit);
40
41
        return $this->getFullRecord($data);
42
    }
43
}
44