Skip to content

Commit

Permalink
Merge pull request #3703 from LibreSign/backport/3699/stable28
Browse files Browse the repository at this point in the history
[stable28] chore: adjust filter condition
  • Loading branch information
vitormattos authored Sep 14, 2024
2 parents 5802dde + aa5805d commit 0cb95a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Db/SignRequestMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function getByUuid(string $uuid): SignRequest {
);
/** @var SignRequest */
$signRequest = $this->findEntity($qb);
if (!array_filter($this->signers, fn ($s) => $s->getId() !== $signRequest->getId())) {
if (!array_filter($this->signers, fn ($s) => $s->getId() === $signRequest->getId())) {
$this->signers[] = $signRequest;
}
return $signRequest;
Expand Down Expand Up @@ -188,7 +188,7 @@ public function getByFileId(int $fileId): array {
/** @var SignRequest[] */
$signers = $this->findEntities($qb);
foreach ($signers as $signRequest) {
if (!array_filter($signers, fn ($s) => $s->getId() !== $signRequest->getId())) {
if (!array_filter($this->signers, fn ($s) => $s->getId() === $signRequest->getId())) {
$this->signers[] = $signRequest;
}
}
Expand All @@ -214,7 +214,7 @@ public function getById(int $signRequestId): SignRequest {

/** @var SignRequest */
$signRequest = $this->findEntity($qb);
if (!array_filter($this->signers, fn ($s) => $s->getId() !== $signRequest->getId())) {
if (!array_filter($this->signers, fn ($s) => $s->getId() === $signRequest->getId())) {
$this->signers[] = $signRequest;
}
return $signRequest;
Expand Down Expand Up @@ -277,7 +277,7 @@ public function getByFileUuid(string $uuid) {
/** @var SignRequest[] */
$signers = $this->findEntities($qb);
foreach ($signers as $signRequest) {
if (!array_filter($signers, fn ($s) => $s->getId() !== $signRequest->getId())) {
if (!array_filter($this->signers, fn ($s) => $s->getId() === $signRequest->getId())) {
$this->signers[] = $signRequest;
}
}
Expand All @@ -295,7 +295,7 @@ public function getBySignerUuidAndUserId(string $uuid): SignRequest {

/** @var SignRequest */
$signRequest = $this->findEntity($qb);
if (!array_filter($this->signers, fn ($s) => $s->getId() !== $signRequest->getId())) {
if (!array_filter($this->signers, fn ($s) => $s->getId() === $signRequest->getId())) {
$this->signers[] = $signRequest;
}
return $signRequest;
Expand Down Expand Up @@ -350,7 +350,7 @@ public function getByFileIdAndSignRequestId(int $fileId, int $signRequestId): Si
);

$signRequest = $this->findEntity($qb);
if (!array_filter($this->signers, fn ($s) => $s->getId() !== $signRequest->getId())) {
if (!array_filter($this->signers, fn ($s) => $s->getId() === $signRequest->getId())) {
$this->signers[] = $signRequest;
}
/** @var SignRequest */
Expand Down

0 comments on commit 0cb95a8

Please sign in to comment.