| @@ 162-179 (lines=18) @@ | ||
| 159 | /** |
|
| 160 | * @inheritdoc |
|
| 161 | */ |
|
| 162 | public function equals($other) |
|
| 163 | { |
|
| 164 | if (!$other instanceof static) { |
|
| 165 | return false; |
|
| 166 | } |
|
| 167 | ||
| 168 | if ($this->count() !== $other->count()) { |
|
| 169 | return false; |
|
| 170 | } |
|
| 171 | ||
| 172 | foreach ($this->items as $item) { |
|
| 173 | if ($this->countItem($item) !== $other->countItem($item)) { |
|
| 174 | return false; |
|
| 175 | } |
|
| 176 | } |
|
| 177 | ||
| 178 | return true; |
|
| 179 | } |
|
| 180 | ||
| 181 | /** |
|
| 182 | * @inheritdoc |
|
| @@ 166-183 (lines=18) @@ | ||
| 163 | /** |
|
| 164 | * @inheritdoc |
|
| 165 | */ |
|
| 166 | public function equals($other) |
|
| 167 | { |
|
| 168 | if (!$other instanceof static) { |
|
| 169 | return false; |
|
| 170 | } |
|
| 171 | ||
| 172 | if ($this->count() !== $other->count()) { |
|
| 173 | return false; |
|
| 174 | } |
|
| 175 | ||
| 176 | foreach ($this->items as $item) { |
|
| 177 | if ($this->countItem($item) !== $other->countItem($item)) { |
|
| 178 | return false; |
|
| 179 | } |
|
| 180 | } |
|
| 181 | ||
| 182 | return true; |
|
| 183 | } |
|
| 184 | ||
| 185 | /** |
|
| 186 | * @inheritdoc |
|