diff --git a/src/Persisters/Entity/BasicEntityPersister.php b/src/Persisters/Entity/BasicEntityPersister.php index 377e03ce274..7e03278984e 100644 --- a/src/Persisters/Entity/BasicEntityPersister.php +++ b/src/Persisters/Entity/BasicEntityPersister.php @@ -835,7 +835,10 @@ public function count(array|Criteria $criteria = []): int ? $this->expandCriteriaParameters($criteria) : $this->expandParameters($criteria); - return (int) $this->conn->executeQuery($sql, $params, $types)->fetchOne(); + /** @psalm-var 0|positive-int $count */ + $count = (int) $this->conn->executeQuery($sql, $params, $types)->fetchOne(); + + return $count; } /**