@@ 59-68 (lines=10) @@ | ||
56 | return isset($this->items[$key]); |
|
57 | } |
|
58 | ||
59 | public function search($value): string |
|
60 | { |
|
61 | foreach ($this->items as $key => $item) { |
|
62 | if ($this->theseAreEqual($item, $value)) { |
|
63 | return $key; |
|
64 | } |
|
65 | } |
|
66 | ||
67 | throw OutOfRangeException::doesNotContainValue($value); |
|
68 | } |
|
69 | ||
70 | public function equals($other): bool |
|
71 | { |
@@ 51-60 (lines=10) @@ | ||
48 | return $this->items[$index]; |
|
49 | } |
|
50 | ||
51 | public function search($value): int |
|
52 | { |
|
53 | foreach ($this->items as $index => $item) { |
|
54 | if ($this->theseAreEqual($item, $value)) { |
|
55 | return $index; |
|
56 | } |
|
57 | } |
|
58 | ||
59 | throw OutOfRangeException::doesNotContainValue($value); |
|
60 | } |
|
61 | ||
62 | public function equals($other): bool |
|
63 | { |