Skip to content

Commit

Permalink
Merge pull request #3699 from LibreSign/fix/adjust-filter-condition
Browse files Browse the repository at this point in the history
chore: adjust filter condition
  • Loading branch information
vitormattos authored Sep 14, 2024
2 parents baef8da + 07492e3 commit bb48a87
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 @@ -106,7 +106,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 @@ -155,7 +155,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 @@ -181,7 +181,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 @@ -244,7 +244,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 @@ -262,7 +262,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 @@ -317,7 +317,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 bb48a87

Please sign in to comment.