Code Duplication    Length = 12-13 lines in 3 locations

Result/ObjectCallbackIterator.php 2 locations

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

Result/ObjectIterator.php 1 location

@@ 94-105 (lines=12) @@
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function offsetGet($offset)
95
    {
96
        $value = parent::offsetGet($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}