Skip to content

Commit

Permalink
BUGFIX: Replace deprecated usage of DBAL functions
Browse files Browse the repository at this point in the history
Addresses the two deprecation warnings:

```
The usage of a string $tableNames in AbstractSchemaManager::tablesExist() is deprecated. Pass a one-element array instead.

QueryBuilder::execute() is deprecated, use QueryBuilder::executeQuery() for SQL queries instead.
```
  • Loading branch information
bwaidelich authored Dec 29, 2024
1 parent b60443b commit 7823ad0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DoctrineEventStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private function determineRequiredSqlStatements(): array
assert($schemaManager !== null);
$platform = $this->connection->getDatabasePlatform();
assert($platform !== null);
if (!$schemaManager->tablesExist($this->eventTableName)) {
if (!$schemaManager->tablesExist([$this->eventTableName])) {
return $platform->getCreateTableSQL($this->createEventStoreSchema($schemaManager)->getTable($this->eventTableName));
}
$tableSchema = $schemaManager->introspectTable($this->eventTableName);
Expand Down Expand Up @@ -259,7 +259,7 @@ private function getStreamVersion(StreamName $streamName): MaybeVersion
->from($this->eventTableName)
->where('stream = :streamName')
->setParameter('streamName', $streamName->value)
->execute();
->executeQuery();
if (!$result instanceof Result) {
throw new \RuntimeException(sprintf('Failed to determine stream version of stream "%s"', $streamName->value), 1651153859);
}
Expand Down

0 comments on commit 7823ad0

Please sign in to comment.