ArrayRow::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
nc 1
cc 1
eloc 3
nop 2
crap 1
1
<?php
2
3
namespace Nayjest\Querying\Row;
4
5
class ArrayRow extends AbstractRow
6
{
7
    private $data;
8
9 5
    public function __construct(DynamicFieldsRegistry $dynamicFields, array $data)
10
    {
11 5
        $this->data = $data;
12 5
        parent::__construct($dynamicFields);
13 5
    }
14
15
    /**
16
     * @return array
17
     */
18 1
    public function getSrc()
19
    {
20 1
        return $this->data;
21
    }
22
23 2
    protected function getInternal($fieldName)
24
    {
25 2
        return $this->data[$fieldName];
26
    }
27
28 2
    protected function hasInternal($fieldName)
29
    {
30 2
        return array_key_exists($fieldName, $this->data);
31
    }
32
}
33