Selection   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 1
c 5
b 0
f 0
lcom 0
cbo 2
dl 0
loc 35
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 0 22 1
1
<?php
2
3
namespace Xls\Record;
4
5
use Xls\Range;
6
7
class Selection extends AbstractRecord
8
{
9
    const NAME = 'SELECTION';
10
    const ID = 0x001D;
11
12
    /**
13
     * Generate the SELECTION record
14
     *
15
     * @param Range $selection
16
     * @param integer $activePane pane position
17
     * @return string
18
     */
19
    public function getData($selection, $activePane)
20
    {
21
        $rwAct = $selection->getRowFrom(); // Active row
22
        $colAct = $selection->getColFrom(); // Active column
23
        $irefAct = 0; // Active cell ref
24
        $cref = 1; // Number of refs
25
26
        $data = pack(
27
            "CvvvvvvCC",
28
            $activePane,
29
            $rwAct,
30
            $colAct,
31
            $irefAct,
32
            $cref,
33
            $selection->getRowFrom(),
34
            $selection->getRowTo(),
35
            $selection->getColFrom(),
36
            $selection->getColTo()
37
        );
38
39
        return $this->getFullRecord($data);
40
    }
41
}
42