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