Failed Conditions
Push — master ( e245a2...503ac3 )
by Arnold
8s
created

Reference::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 2
1
<?php
2
3
namespace LegalThings\DataEnricher\Processor;
4
5
use LegalThings\DataEnricher\Processor;
6
use LegalThings\DataEnricher\Processor\Helper;
7
use LegalThings\DataEnricher\Node;
8
9
/**
10
 * Symbolic link to a property of the source object
11
 */
12
class Reference implements Processor
13
{
14
    use Processor\Implementation,
15
        Helper\GetByReference
16
    {
17
        Helper\GetByReference::withSourceAndTarget insteadof Processor\Implementation;
18
    }
19
    
20
    /**
21
     * Apply reference processing to a single node
22
     * 
23
     * @param Node $node
24
     */
25
    public function applyToNode(Node $node)
26
    {
27
        $ref = $node->getInstruction($this);
28
        
29
        $result = $this->getByReference($ref, $this->source, $this->target);
30
        $node->setResult($result);
31
    }
32
}
33