Row   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 21
rs 10
c 1
b 0
f 0
ccs 9
cts 9
cp 1
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 6 2
A __construct() 0 3 1
A __isset() 0 3 1
1
<?php
2
3
namespace kalanis\kw_connect\records;
4
5
6
use kalanis\kw_mapper\Records\ARecord;
7
use kalanis\kw_connect\core\Interfaces\IRow;
8
9
10
/**
11
 * Class Row
12
 * @package kalanis\kw_connect\records
13
 */
14
class Row implements IRow
15
{
16
    protected ARecord $record;
17
18 6
    public function __construct(ARecord $record)
19
    {
20 6
        $this->record = $record;
21 6
    }
22
23 6
    public function getValue($property)
24
    {
25 6
        if (method_exists($this->record, strval($property))) {
26 1
            return call_user_func([$this->record, strval($property)]);
27
        } else {
28 6
            return $this->record->__get($property);
29
        }
30
    }
31
32 4
    public function __isset($name)
33
    {
34 4
        return $this->record->offsetExists($name);
35
    }
36
}
37