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