Code Duplication    Length = 12-13 lines in 3 locations

Result/ObjectCallbackIterator.php 2 locations

@@ 28-40 (lines=13) @@
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function current()
29
    {
30
        $value = parent::current();
31
32
        // Generate objects on demand
33
        if ($value === null && $this->valid()) {
34
            $key = $this->key();
35
            $callback = $this->callback;
36
            return $callback($key);
37
        }
38
39
        return $value;
40
    }
41
42
    /**
43
     * {@inheritdoc}
@@ 45-56 (lines=12) @@
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function offsetGet($offset)
46
    {
47
        $value = parent::offsetGet($offset);
48
49
        // Generate objects on demand
50
        if ($value === null && $this->valid()) {
51
            $callback = $this->callback;
52
            return $callback($offset);
53
        }
54
55
        return $value;
56
    }
57
}
58

Result/ObjectIterator.php 1 location

@@ 94-105 (lines=12) @@
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function get($offset)
95
    {
96
        $value = parent::get($offset);
97
98
        // Generate objects on demand
99
        if ($value === null && $this->containsKey($this->key())) {
100
            $callback = $this->convertCallback;
101
            return $callback($offset);
102
        }
103
104
        return $value;
105
    }
106
107
    /**
108
     * {@inheritdoc}