From 6d4d18f153b4566c959040084f9997a934da65de Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 14 Sep 2024 16:45:27 -0300 Subject: [PATCH] chore: adjust filter condition Signed-off-by: Vitor Mattos --- lib/Db/SignRequestMapper.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Db/SignRequestMapper.php b/lib/Db/SignRequestMapper.php index 4a9e292fa..0a2a0ccb1 100644 --- a/lib/Db/SignRequestMapper.php +++ b/lib/Db/SignRequestMapper.php @@ -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; @@ -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; } } @@ -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; @@ -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; } } @@ -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; @@ -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 */