AddRowOperation::fromArray()   A
last analyzed

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 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 1
crap 2
1
<?php
2
namespace Nayjest\Querying\Operation;
3
4
use Nayjest\Querying\Row\ArrayRow;
5
6
class AddRowOperation implements OperationInterface
7
{
8
    /**
9
     * @var
10
     */
11
    private $src;
12
13
    /**
14
     * @var
15
     */
16
    private $rowClass;
17
18
    public static function fromArray(array $src)
19
    {
20
        return new static($src, ArrayRow::class);
21
    }
22
23
    public function __construct($src, $rowClass)
24
    {
25
        $this->src = $src;
26
        $this->rowClass = $rowClass;
27
    }
28
29
    public function getSrc()
30
    {
31
        return $this->src;
32
    }
33
34
    public function getRowClass()
35
    {
36
        return $this->rowClass;
37
    }
38
}
39