Code Duplication    Length = 11-11 lines in 2 locations

src/Zicht/Itertools/lib/Traits/ArrayAccessTrait.php 1 location

@@ 36-46 (lines=11) @@
33
     * @param mixed $default
34
     * @return mixed
35
     */
36
    public function offsetGet($offset, $default = null)
37
    {
38
        if ($this instanceof \Traversable) {
39
            foreach ($this as $key => $value) {
40
                if ($key === $offset) {
41
                    return $value;
42
                }
43
            }
44
        }
45
        return $default;
46
    }
47
48
    /**
49
     * Not implemented

src/Zicht/Itertools/lib/Traits/GetterTrait.php 1 location

@@ 36-46 (lines=11) @@
33
     * @param mixed $default
34
     * @return mixed
35
     */
36
    public function get($offset, $default = null)
37
    {
38
        if ($this instanceof \Traversable) {
39
            foreach ($this as $key => $value) {
40
                if ($key === $offset) {
41
                    return $value;
42
                }
43
            }
44
        }
45
        return $default;
46
    }
47
}
48