Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01316d6

Browse files
committed
bug #39026 [Messenger] Fix DBAL deprecations in PostgreSqlConnection (chalasr)
This PR was merged into the 5.1 branch. Discussion ---------- [Messenger] Fix DBAL deprecations in PostgreSqlConnection | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- bc42cf6 [Messenger] Fix DBAL deprecations in PostgreSQLConnection
2 parents 8c81f33 + bc42cf6 commit 01316d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private function executeQuery(string $sql, array $parameters = [], array $types
372372
return $stmt;
373373
}
374374

375-
private function executeStatement(string $sql, array $parameters = [], array $types = [])
375+
protected function executeStatement(string $sql, array $parameters = [], array $types = [])
376376
{
377377
try {
378378
if (method_exists($this->driverConnection, 'executeStatement')) {

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function get(): ?array
6464
if (!$this->listening) {
6565
// This is secure because the table name must be a valid identifier:
6666
// https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
67-
$this->driverConnection->exec(sprintf('LISTEN "%s"', $this->configuration['table_name']));
67+
$this->executeStatement(sprintf('LISTEN "%s"', $this->configuration['table_name']));
6868
$this->listening = true;
6969
}
7070

@@ -87,7 +87,7 @@ public function setup(): void
8787
{
8888
parent::setup();
8989

90-
$this->driverConnection->exec(implode("\n", $this->getTriggerSql()));
90+
$this->executeStatement(implode("\n", $this->getTriggerSql()));
9191
}
9292

9393
/**
@@ -134,7 +134,7 @@ private function unlisten()
134134
return;
135135
}
136136

137-
$this->driverConnection->exec(sprintf('UNLISTEN "%s"', $this->configuration['table_name']));
137+
$this->executeStatement(sprintf('UNLISTEN "%s"', $this->configuration['table_name']));
138138
$this->listening = false;
139139
}
140140
}

0 commit comments

Comments
 (0)