| @@ 146-163 (lines=18) @@ | ||
| 143 | /** |
|
| 144 | * @inheritdoc |
|
| 145 | */ |
|
| 146 | public function equals($other) |
|
| 147 | { |
|
| 148 | if (!$other instanceof static) { |
|
| 149 | return false; |
|
| 150 | } |
|
| 151 | ||
| 152 | if ($this->count() !== $other->count()) { |
|
| 153 | return false; |
|
| 154 | } |
|
| 155 | ||
| 156 | foreach ($this->items as $item) { |
|
| 157 | if ($this->countItem($item) !== $other->countItem($item)) { |
|
| 158 | return false; |
|
| 159 | } |
|
| 160 | } |
|
| 161 | ||
| 162 | return true; |
|
| 163 | } |
|
| 164 | ||
| 165 | /** |
|
| 166 | * @inheritdoc |
|
| @@ 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 |
|