InitializeRowsHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPriority() 0 4 1
A apply() 0 9 2
1
<?php
2
3
namespace Nayjest\Querying\Handler;
4
5
use Nayjest\Querying\Operation\InitializeRowsOperation;
6
7
class InitializeRowsHandler extends AbstractHandler
8
{
9
    const PRIORITY = Priority::INITIALIZE_ROWS;
10
11 10
    public function getPriority()
12
    {
13 10
        return self::PRIORITY;
14
    }
15
16 11
    public function apply($dataSource)
17
    {
18
        /** @var InitializeRowsOperation $operation */
19 11
        $operation = $this->operation;
20 11
        $rowClass = $operation->getRowClass();
21 11
        foreach($dataSource as $row) {
22 10
            yield new $rowClass($operation->getDynamicFields(), $row);
23 11
        }
24 11
    }
25
}
26