Unknown::write()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 2
b 0
f 0
nc 2
nop 1
dl 0
loc 8
ccs 0
cts 6
cp 0
crap 6
rs 10
1
<?php
2
3
namespace SPSS\Sav\Record\Info;
4
5
use SPSS\Buffer;
6
use SPSS\Sav\Record\Info;
7
8
class Unknown extends Info
9
{
10
    /**
11
     * @param Buffer $buffer
12
     */
13
    public function read(Buffer $buffer)
14
    {
15
        parent::read($buffer);
16
        $this->data['raw'] = $buffer->readString($this->dataSize * $this->dataCount);
17
    }
18
19
    /**
20
     * @param Buffer $buffer
21
     */
22
    public function write(Buffer $buffer)
23
    {
24
        if (! isset($this->data['raw'])) {
25
            $this->data['raw'] = '';
26
        }
27
        $this->dataCount = strlen($this->data['raw']);
28
        parent::write($buffer);
29
        $buffer->writeString($this->data['raw']);
30
    }
31
}
32