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

@@ 133-144 (lines=12) @@
130
    /**
131
     * {@inheritdoc}
132
     */
133
    public function get($offset)
134
    {
135
        $value = parent::get($offset);
136
137
        // Generate objects on demand
138
        if ($value === null && $this->containsKey($this->key())) {
139
            $callback = $this->convertCallback;
140
            return $callback($offset);
141
        }
142
143
        return $value;
144
    }
145
146
    /**
147
     * {@inheritdoc}