Skip to content

Commit 01aabcf

Browse files
committed
Make reasons unique
1 parent 1b4b134 commit 01aabcf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Type/AcceptsResult.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use PHPStan\TrinaryLogic;
77
use function array_map;
88
use function array_merge;
9+
use function array_unique;
10+
use function array_values;
911

1012
/** @api */
1113
class AcceptsResult
@@ -60,15 +62,15 @@ public function and(self $other): self
6062
{
6163
return new self(
6264
$this->result->and($other->result),
63-
array_merge($this->reasons, $other->reasons),
65+
array_values(array_unique(array_merge($this->reasons, $other->reasons))),
6466
);
6567
}
6668

6769
public function or(self $other): self
6870
{
6971
return new self(
7072
$this->result->or($other->result),
71-
array_merge($this->reasons, $other->reasons),
73+
array_values(array_unique(array_merge($this->reasons, $other->reasons))),
7274
);
7375
}
7476

0 commit comments

Comments
 (0)