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

@@ 188-199 (lines=12) @@
185
    /**
186
     * {@inheritdoc}
187
     */
188
    public function get($offset)
189
    {
190
        $value = parent::get($offset);
191
192
        // Generate objects on demand
193
        if ($value === null && $this->containsKey($this->key())) {
194
            $callback = $this->convertCallback;
195
            return $callback($offset);
196
        }
197
198
        return $value;
199
    }
200
201
    /**
202
     * {@inheritdoc}