Code Duplication    Length = 8-10 lines in 5 locations

src/Immutable/ImmArrayList.php 1 location

@@ 28-37 (lines=10) @@
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function get($index)
29
    {
30
        $this->validateKeyType($index);
31
32
        if ($this->containsKey($index) === false) {
33
            throw new OutOfBoundsException('No element at position ' . $index);
34
        }
35
36
        return $this->container[$index];
37
    }
38
39
    /**
40
     * {@inheritdoc}

src/Immutable/ImmDictionary.php 1 location

@@ 22-29 (lines=8) @@
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function get($index)
23
    {
24
        if ($this->containsKey($index) === false) {
25
            throw new \OutOfBoundsException('No element at position ' . $index);
26
        }
27
28
        return $this->container[$index];
29
    }
30
31
    /**
32
     * {@inheritdoc}

src/Immutable/ImmSet.php 1 location

@@ 27-36 (lines=10) @@
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function get($index)
28
    {
29
        $this->validateKeyType($index);
30
31
        if ($this->containsKey($index) === false) {
32
            throw new \OutOfBoundsException('No element at position ' . $index);
33
        }
34
35
        return $this->container[$index];
36
    }
37
38
    /**
39
     * {@inheritdoc}

src/Dictionary.php 2 locations

@@ 34-41 (lines=8) @@
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function get($index)
35
    {
36
        if ($this->containsKey($index) === false) {
37
            throw new \OutOfBoundsException('No element at position ' . $index);
38
        }
39
40
        return $this->container[$index];
41
    }
42
43
    /**
44
     * {@inheritdoc}
@@ 136-145 (lines=10) @@
133
    /**
134
     * {@inheritdoc}
135
     */
136
    public function removeKey($key)
137
    {
138
        if ($this->containsKey($key) === false) {
139
            throw new \OutOfBoundsException('No element at position ' . $key);
140
        }
141
142
        unset($this->container[$key]);
143
144
        return $this;
145
    }
146
147
    /**
148
     * {@inheritdoc}