Rename $statement and $prepareString in Connection::prepare() to $sql

parent 478d4f0f
......@@ -849,18 +849,18 @@ class Connection implements DriverConnection
/**
* Prepares an SQL statement.
*
* @param string $statement The SQL statement to prepare.
* @param string $sql The SQL statement to prepare.
*
* @return Statement The prepared statement.
*
* @throws DBALException
*/
public function prepare($statement)
public function prepare($sql)
{
try {
$stmt = new Statement($statement, $this);
$stmt = new Statement($sql, $this);
} catch (Throwable $ex) {
throw DBALException::driverExceptionDuringQuery($this->_driver, $ex, $statement);
throw DBALException::driverExceptionDuringQuery($this->_driver, $ex, $sql);
}
$stmt->setFetchMode($this->defaultFetchMode);
......
......@@ -372,10 +372,10 @@ class MasterSlaveConnection extends Connection
/**
* {@inheritDoc}
*/
public function prepare($statement)
public function prepare($sql)
{
$this->connect('master');
return parent::prepare($statement);
return parent::prepare($sql);
}
}
......@@ -15,11 +15,11 @@ interface Connection
/**
* Prepares a statement for execution and returns a Statement object.
*
* @param string $prepareString
* @param string $sql
*
* @return Statement
*/
public function prepare($prepareString);
public function prepare($sql);
/**
* Executes an SQL statement, returning a result set as a Statement object.
......
......@@ -128,9 +128,9 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
/**
* {@inheritdoc}
*/
public function prepare($prepareString)
public function prepare($sql)
{
return new MysqliStatement($this->conn, $prepareString);
return new MysqliStatement($this->conn, $sql);
}
/**
......
......@@ -104,9 +104,9 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
/**
* {@inheritdoc}
*/
public function prepare($prepareString)
public function prepare($sql)
{
return new OCI8Statement($this->dbh, $prepareString, $this);
return new OCI8Statement($this->dbh, $sql, $this);
}
/**
......
......@@ -57,15 +57,15 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
}
/**
* @param string $prepareString
* @param string $sql
* @param array<int, int> $driverOptions
*
* @return \PDOStatement
*/
public function prepare($prepareString, $driverOptions = [])
public function prepare($sql, $driverOptions = [])
{
try {
$statement = parent::prepare($prepareString, $driverOptions);
$statement = parent::prepare($sql, $driverOptions);
assert($statement instanceof \PDOStatement);
return $statement;
......
......@@ -144,9 +144,9 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection
/**
* {@inheritdoc}
*/
public function prepare($prepareString)
public function prepare($sql)
{
return new SQLAnywhereStatement($this->connection, $prepareString);
return new SQLAnywhereStatement($this->connection, $sql);
}
/**
......
......@@ -113,9 +113,9 @@ class Connection extends \Doctrine\DBAL\Connection
*
* @return Statement
*/
public function prepare($statement)
public function prepare($sql)
{
$stmt = new Statement(parent::prepare($statement), $this);
$stmt = new Statement(parent::prepare($sql), $this);
$stmt->setFetchMode($this->defaultFetchMode);
return $stmt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment