Skip to content

Commit 38fd45f

Browse files
committed
check the returned Statement type
If the Statement that was found in the underlying persistence layer is a void Statement, it must not be returned by calls to `findStatementById()` and vice versa.
1 parent 504a2cb commit 38fd45f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Manager/StatementManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function findStatementById($statementId)
4242
/** @var Statement $statement */
4343
$statement = $this->repository->findOneBy(array('id' => $statementId));
4444

45-
if (null === $statement) {
45+
if (null === $statement || $statement->isVoidStatement()) {
4646
throw new NotFoundException();
4747
}
4848

@@ -57,7 +57,7 @@ public function findVoidedStatementById($statementId)
5757
/** @var Statement $statement */
5858
$statement = $this->repository->findOneBy(array('id' => $statementId));
5959

60-
if (null === $statement) {
60+
if (null === $statement || !$statement->isVoidStatement()) {
6161
throw new NotFoundException();
6262
}
6363

0 commit comments

Comments
 (0)