[Messenger] Fix DBAL deprecations in PostgreSQLConnection

This commit is contained in:
Robin Chalas 2020-11-07 15:33:20 +01:00
parent 8c81f33840
commit bc42cf604e
2 changed files with 4 additions and 4 deletions

View File

@ -372,7 +372,7 @@ class Connection implements ResetInterface
return $stmt; return $stmt;
} }
private function executeStatement(string $sql, array $parameters = [], array $types = []) protected function executeStatement(string $sql, array $parameters = [], array $types = [])
{ {
try { try {
if (method_exists($this->driverConnection, 'executeStatement')) { if (method_exists($this->driverConnection, 'executeStatement')) {

View File

@ -64,7 +64,7 @@ final class PostgreSqlConnection extends Connection
if (!$this->listening) { if (!$this->listening) {
// This is secure because the table name must be a valid identifier: // 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 // 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; $this->listening = true;
} }
@ -87,7 +87,7 @@ final class PostgreSqlConnection extends Connection
{ {
parent::setup(); parent::setup();
$this->driverConnection->exec(implode("\n", $this->getTriggerSql())); $this->executeStatement(implode("\n", $this->getTriggerSql()));
} }
/** /**
@ -134,7 +134,7 @@ SQL
return; return;
} }
$this->driverConnection->exec(sprintf('UNLISTEN "%s"', $this->configuration['table_name'])); $this->executeStatement(sprintf('UNLISTEN "%s"', $this->configuration['table_name']));
$this->listening = false; $this->listening = false;
} }
} }