We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bde29ee commit 0357aa9Copy full SHA for 0357aa9
1 file changed
src/Reflection/Assertions.php
@@ -122,23 +122,15 @@ public function intersect(Assertions $other): self
122
}
123
124
$merged = [];
125
- $usedOther = [];
126
-
127
foreach ($thisAsserts as $thisAssert) {
128
$key = self::getAssertKey($thisAssert);
129
130
- foreach ($otherAsserts as $j => $otherAssert) {
131
- if (isset($usedOther[$j])) {
132
- continue;
133
- }
134
+ foreach ($otherAsserts as $otherAssert) {
135
if (self::getAssertKey($otherAssert) !== $key) {
136
continue;
137
138
139
$merged[] = $thisAssert->withType(TypeCombinator::union($thisAssert->getType(), $otherAssert->getType()));
140
- $usedOther[$j] = true;
141
- break;
142
143
144
0 commit comments