| @@ 138-155 (lines=18) @@ | ||
| 135 | return isset($this->items[$key]); |
|
| 136 | } |
|
| 137 | ||
| 138 | public function equals($other): bool |
|
| 139 | { |
|
| 140 | if (!$other instanceof static) { |
|
| 141 | return false; |
|
| 142 | } |
|
| 143 | ||
| 144 | if ($this->count() !== $other->count()) { |
|
| 145 | return false; |
|
| 146 | } |
|
| 147 | ||
| 148 | foreach ($this->items as $item) { |
|
| 149 | if ($this->countItem($item) !== $other->countItem($item)) { |
|
| 150 | return false; |
|
| 151 | } |
|
| 152 | } |
|
| 153 | ||
| 154 | return true; |
|
| 155 | } |
|
| 156 | ||
| 157 | public function count(): int |
|
| 158 | { |
|
| @@ 134-151 (lines=18) @@ | ||
| 131 | return isset($this->items[$index]); |
|
| 132 | } |
|
| 133 | ||
| 134 | public function equals($other): bool |
|
| 135 | { |
|
| 136 | if (!$other instanceof static) { |
|
| 137 | return false; |
|
| 138 | } |
|
| 139 | ||
| 140 | if ($this->count() !== $other->count()) { |
|
| 141 | return false; |
|
| 142 | } |
|
| 143 | ||
| 144 | foreach ($this->items as $item) { |
|
| 145 | if ($this->countItem($item) !== $other->countItem($item)) { |
|
| 146 | return false; |
|
| 147 | } |
|
| 148 | } |
|
| 149 | ||
| 150 | return true; |
|
| 151 | } |
|
| 152 | ||
| 153 | public function count(): int |
|
| 154 | { |
|