Skip to content

Commit 0357aa9

Browse files
committed
simplify
1 parent bde29ee commit 0357aa9

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/Reflection/Assertions.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,15 @@ public function intersect(Assertions $other): self
122122
}
123123

124124
$merged = [];
125-
$usedOther = [];
126-
127125
foreach ($thisAsserts as $thisAssert) {
128126
$key = self::getAssertKey($thisAssert);
129127

130-
foreach ($otherAsserts as $j => $otherAssert) {
131-
if (isset($usedOther[$j])) {
132-
continue;
133-
}
134-
128+
foreach ($otherAsserts as $otherAssert) {
135129
if (self::getAssertKey($otherAssert) !== $key) {
136130
continue;
137131
}
138132

139133
$merged[] = $thisAssert->withType(TypeCombinator::union($thisAssert->getType(), $otherAssert->getType()));
140-
$usedOther[$j] = true;
141-
break;
142134
}
143135
}
144136

0 commit comments

Comments
 (0)