Code Duplication    Length = 10-11 lines in 2 locations

src/DataEnricher/Node.php 1 location

@@ 43-53 (lines=11) @@
40
     * 
41
     * @param array|object $target
42
     */
43
    protected function applyNodeResults(&$target)
44
    {
45
        if ($target instanceof self) {
46
            $target = $target->getResult();
47
            $this->applyNodeResults($target);
48
        } elseif (is_array($target) || is_object($target)) {
49
            foreach ($target as &$value) {         
50
                $this->applyNodeResults($value);
51
            }
52
        }
53
    }
54
    
55
    /**
56
     * Get the processed result

src/DataEnricher.php 1 location

@@ 159-168 (lines=10) @@
156
     * 
157
     * @param array|object $target
158
     */
159
    protected function applyNodeResults(&$target)
160
    {
161
        foreach ($target as &$value) {
162
            if ($value instanceof Node) {
163
                $value = $value->getResult();
164
            } elseif (is_array($value) || is_object($value)) {
165
                $this->applyNodeResults($value);
166
            }
167
        }
168
    }
169
}
170