Record::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace SPSS\Sav;
4
5
use SPSS\Buffer;
6
7
abstract class Record implements RecordInterface
8
{
9
    /**
10
     * Record constructor.
11
     *
12
     * @param array $data
13
     */
14 2
    public function __construct($data = [])
15
    {
16 2
        foreach ($data as $key => $value) {
17
            $this->{$key} = $value;
18
        }
19 2
    }
20
21
    /**
22
     * @param Buffer $buffer
23
     * @param array $data
24
     * @return static
25
     */
26 2
    public static function fill(Buffer $buffer, $data = [])
27
    {
28 2
        $record = new static($data);
29 2
        $record->read($buffer);
30
31 2
        return $record;
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function toArray()
38
    {
39
        return [];
40
    }
41
}
42