diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php index ba095f288c..51d29c6353 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php @@ -372,7 +372,7 @@ class Connection implements ResetInterface return $stmt; } - private function executeStatement(string $sql, array $parameters = [], array $types = []) + protected function executeStatement(string $sql, array $parameters = [], array $types = []) { try { if (method_exists($this->driverConnection, 'executeStatement')) { diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php index 79a1dd68ba..9dc8b77e38 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php @@ -64,7 +64,7 @@ final class PostgreSqlConnection extends Connection if (!$this->listening) { // This is secure because the table name must be a valid identifier: // https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS - $this->driverConnection->exec(sprintf('LISTEN "%s"', $this->configuration['table_name'])); + $this->executeStatement(sprintf('LISTEN "%s"', $this->configuration['table_name'])); $this->listening = true; } @@ -87,7 +87,7 @@ final class PostgreSqlConnection extends Connection { parent::setup(); - $this->driverConnection->exec(implode("\n", $this->getTriggerSql())); + $this->executeStatement(implode("\n", $this->getTriggerSql())); } /** @@ -134,7 +134,7 @@ SQL return; } - $this->driverConnection->exec(sprintf('UNLISTEN "%s"', $this->configuration['table_name'])); + $this->executeStatement(sprintf('UNLISTEN "%s"', $this->configuration['table_name'])); $this->listening = false; } }