Code Duplication    Length = 10-12 lines in 2 locations

src/Traits/ArrayAccessTrait.php 1 location

@@ 31-40 (lines=10) @@
28
     * @param mixed $offset
29
     * @param mixed $value
30
     */
31
    public function offsetSet($offset, $value)
32
    {
33
        if (is_null($offset)) {
34
            $this->data[] = $value;
35
        } else {
36
            $this->data[$offset] = $value;
37
        }
38
39
        $this->keys = array_keys($this->data);
40
    }
41
42
    /**
43
     * Retrieves given offset from current collection.

src/Traits/LazyArrayAccess.php 1 location

@@ 33-44 (lines=12) @@
30
     * @param mixed $offset
31
     * @param mixed $value
32
     */
33
    public function offsetSet($offset, $value)
34
    {
35
        $this->checkLazyLoad();
36
37
        if (is_null($offset)) {
38
            $this->items[] = $value;
39
        } else {
40
            $this->items[$offset] = $value;
41
        }
42
43
        $this->keys = array_keys($this->items);
44
    }
45
46
    /**
47
     * Retrieves given offset from current collection.