DataValidations::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 18
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 18
loc 18
rs 9.4285
cc 1
eloc 13
nc 1
nop 1
1
<?php
2
3
namespace Xls\Record;
4
5 View Code Duplication
class DataValidations 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...
6
{
7
    const NAME = 'DATAVALIDATIONS';
8
    const ID = 0x01B2;
9
10
    /**
11
     * Generate the DVAL biff record
12
     * @param $dv
13
     *
14
     * @return string
15
     */
16
    public function getData($dv)
17
    {
18
        $grbit = 0x02; // Prompt box at cell, no cached validity data at DV records
19
        $horPos = 0x00; // Horizontal position of prompt box, if fixed position
20
        $verPos = 0x00; // Vertical position of prompt box, if fixed position
21
        $objId = 0xffffffff; // Object identifier of drop down arrow object, or -1 if not visible
22
23
        $data = pack(
24
            'vVVVV',
25
            $grbit,
26
            $horPos,
27
            $verPos,
28
            $objId,
29
            count($dv)
30
        );
31
32
        return $this->getFullRecord($data);
33
    }
34
}
35