Skip to content

Commit 6fd1490

Browse files
Updated and fixed - tests passing
1 parent 20b6afe commit 6fd1490

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Mbh/Collection/Traits/Sequenceable/LinkedList.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ public function clear()
8585

8686
public function contains(...$values): bool
8787
{
88-
return $this->indexOf($values, $f) >= 0;
88+
foreach ($values as &$value) {
89+
if ($this->search($value) === null) {
90+
return false;
91+
}
92+
}
93+
94+
return true;
8995
}
9096

9197
public function copy()
@@ -398,6 +404,8 @@ protected function validIndex(int $index)
398404
return $this->offsetExists($index);
399405
}
400406

407+
abstract protected function emptyGuard($method);
408+
401409
abstract public function isEmpty(): bool;
402410

403411
abstract public function search($value);

0 commit comments

Comments
 (0)