Code Duplication    Length = 7-7 lines in 2 locations

src/ArrayList/ArrayList.php 1 location

@@ 208-214 (lines=7) @@
205
    public function retainAll($elements) {
206
        $elements = $this->collectionToArray($elements);
207
208
        foreach($this->data as $index => $item) {
209
            if(array_search($item, $elements, TRUE) !== FALSE) {
210
                continue;
211
            }
212
213
            unset($this->data[$index]);
214
        }
215
    }
216
217
    /**

src/Set/HashSet.php 1 location

@@ 151-157 (lines=7) @@
148
149
        $result = FALSE;
150
151
        foreach($this->data as $index => $data) {
152
            if(array_search($data, $elements) === FALSE) {
153
                unset($this->data[$index]);
154
155
                $result = TRUE;
156
            }
157
        }
158
159
        return $result;
160
    }