Skip to content

Commit

Permalink
Fix possible notice in SetTrait::equals()
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdifabio committed Oct 30, 2017
1 parent 94a89bf commit c7cf41a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SetTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public function equals($object): bool
}

foreach ($this->items as $key => $item) {
$otherItem = $object->items[$key];
if (!self::itemsAreEqual($item, $otherItem)) {
$otherItem = $object->items[$key] ?? null;
if ($otherItem === null || !self::itemsAreEqual($item, $otherItem)) {
return false;
}
}
Expand Down

0 comments on commit c7cf41a

Please sign in to comment.