Skip to content

Commit

Permalink
Make reasons unique
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 11, 2023
1 parent 1b4b134 commit 01aabcf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Type/AcceptsResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use PHPStan\TrinaryLogic;
use function array_map;
use function array_merge;
use function array_unique;
use function array_values;

/** @api */
class AcceptsResult
Expand Down Expand Up @@ -60,15 +62,15 @@ public function and(self $other): self
{
return new self(
$this->result->and($other->result),
array_merge($this->reasons, $other->reasons),
array_values(array_unique(array_merge($this->reasons, $other->reasons))),
);
}

public function or(self $other): self
{
return new self(
$this->result->or($other->result),
array_merge($this->reasons, $other->reasons),
array_values(array_unique(array_merge($this->reasons, $other->reasons))),
);
}

Expand Down

0 comments on commit 01aabcf

Please sign in to comment.