src/ArrayList/ArrayList.php 1 location
|
@@ 196-202 (lines=7) @@
|
| 193 |
|
public function retainAll($elements) { |
| 194 |
|
$elements = $this->collectionToArray($elements); |
| 195 |
|
|
| 196 |
|
foreach($this->data as $index => $item) { |
| 197 |
|
if(array_search($item, $elements, TRUE) !== FALSE) { |
| 198 |
|
continue; |
| 199 |
|
} |
| 200 |
|
|
| 201 |
|
unset($this->data[$index]); |
| 202 |
|
} |
| 203 |
|
} |
| 204 |
|
|
| 205 |
|
} |
src/Set/Set.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 |
|
} |