Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return type issue in prepareVisitEventsStatement #41

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Expand Up @@ -9,9 +9,3 @@ parameters:
message: "#^Cannot call static method fromBytes\\(\\) on Broadway\\\\UuidGenerator\\\\Converter\\\\BinaryUuidConverterInterface\\|null\\.$#"
count: 1
path: src/DBALEventStore.php

-
message: "#^Method Broadway\\\\EventStore\\\\Dbal\\\\DBALEventStore\\:\\:prepareVisitEventsStatement\\(\\) should return Doctrine\\\\DBAL\\\\Driver\\\\Statement but returns Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\.$#"
count: 1
path: src/DBALEventStore.php

4 changes: 2 additions & 2 deletions src/DBALEventStore.php
Expand Up @@ -28,6 +28,7 @@
use Broadway\UuidGenerator\Converter\BinaryUuidConverterInterface;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\DBAL\Schema\Schema;
Expand Down Expand Up @@ -294,7 +295,6 @@ private function convertStorageValueToIdentifier($id)
public function visitEvents(Criteria $criteria, EventVisitor $eventVisitor): void
{
$statement = $this->prepareVisitEventsStatement($criteria);
$statement->execute();

while ($row = $statement->fetch()) {
$domainMessage = $this->deserializeEvent($row);
Expand All @@ -303,7 +303,7 @@ public function visitEvents(Criteria $criteria, EventVisitor $eventVisitor): voi
}
}

private function prepareVisitEventsStatement(Criteria $criteria): Statement
private function prepareVisitEventsStatement(Criteria $criteria): ResultStatement
{
list($where, $bindValues, $bindValueTypes) = $this->prepareVisitEventsStatementWhereAndBindValues($criteria);
$query = 'SELECT uuid, playhead, metadata, payload, recorded_on
Expand Down