diff --git a/src/ResultIterator.php b/src/ResultIterator.php index 17f0cd53..cf263fd5 100644 --- a/src/ResultIterator.php +++ b/src/ResultIterator.php @@ -79,11 +79,11 @@ public function __construct(QueryFactory $queryFactory, array $parameters, $obje $this->logger = $logger; } - protected function executeCountQuery() + protected function executeCountQuery(): void { $sql = $this->magicQuery->build($this->queryFactory->getMagicSqlCount(), $this->parameters); $this->logger->debug('Running count query: '.$sql); - $this->totalCount = $this->tdbmService->getConnection()->fetchColumn($sql, $this->parameters); + $this->totalCount = (int) $this->tdbmService->getConnection()->fetchColumn($sql, $this->parameters); } /** @@ -91,7 +91,7 @@ protected function executeCountQuery() * * @return int */ - public function count() + public function count(): int { if ($this->totalCount === null) { $this->executeCountQuery();