Completed
Push — master ( dd1269...21c3dd )
by Sam
02:11
created

Unknown::read()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
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