Code Duplication    Length = 14-14 lines in 2 locations

src/DataEnricher/Processor/Merge.php 1 location

@@ 20-33 (lines=14) @@
17
     * 
18
     * @param Node $node
19
     */
20
    public function applyToNode(Node $node)
21
    {
22
        $instruction = $node->getInstruction($this);
23
        
24
        $list = $this->resolve($instruction);
25
        
26
        if (isset($list) && !is_array($list)) {
27
            throw new \Exception("Unable to apply {$this->property} processing instruction:"
28
                . " Expected an array, got a " . (is_object($list) ? get_class($list) . ' ' : '') . gettype($list));
29
        }
30
        
31
        $result = $this->execute((array)$list);
32
        $node->setResult($result);
33
    }
34
    
35
    /**
36
     * Resolve processing nodes in the instruction

src/DataEnricher/Processor/Sum.php 1 location

@@ 20-33 (lines=14) @@
17
     * 
18
     * @param Node $node
19
     */
20
    public function applyToNode(Node $node)
21
    {
22
        $instruction = $node->getInstruction($this);
23
        
24
        $list = $this->resolve($instruction);
25
        
26
        if (isset($list) && !is_array($list)) {
27
            throw new \Exception("Unable to apply {$this->property} processing instruction:"
28
                . " Expected an array, got a " . (is_object($list) ? get_class($list) . ' ' : '') . gettype($list));
29
        }
30
        
31
        $result = $this->execute((array)$list);
32
        $node->setResult($result);
33
    }
34
    
35
    /**
36
     * Resolve processing nodes in the instruction