Txo   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getData() 0 30 1
1
<?php
2
namespace Xls\Record;
3
4
use Xls\StringUtils;
5
6
class Txo extends AbstractRecord
7
{
8
    const NAME = 'TXO';
9
    const ID = 0x01B6;
10
11
    /**
12
     * @param $text
13
     *
14
     * @return string
15
     */
16
    public function getData($text)
17
    {
18
        $charCount = StringUtils::countCharacters($text);
19
        $text = StringUtils::toBiff8UnicodeLongWoLenInfo($text);
20
21
        $grbit = 0x0212;
22
        $rotation = 0;
23
        $data = pack('vv', $grbit, $rotation);
24
        $data .= pack('vvv', 0, 0, 0); //reserved
25
        $txoRunsLength = 0x10;
26
        $data .= pack('vv', $charCount, $txoRunsLength);
27
        $data .= pack('V', 0); //reserved
28
29
        $result = $this->getFullRecord($data);
30
31
        $continue = new ContinueRecord();
32
        $result .= $continue->getDataRaw($text);
33
34
        $txoRunsData = pack('H*', '00000500');
35
        $txoRunsData .= pack('H*', '2F00');
36
        $txoRunsData .= pack('H*', '0C00');
37
38
        $lastRun = pack('v', $charCount);
39
        $lastRun .= pack('H*', '000000000200');
40
41
        $txoRunsData .= $lastRun;
42
        $result .= $continue->getDataRaw($txoRunsData);
43
44
        return $result;
45
    }
46
}
47