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

parent 478d4f0f
...@@ -849,18 +849,18 @@ class Connection implements DriverConnection ...@@ -849,18 +849,18 @@ class Connection implements DriverConnection
/** /**
* Prepares an SQL statement. * 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. * @return Statement The prepared statement.
* *
* @throws DBALException * @throws DBALException
*/ */
public function prepare($statement) public function prepare($sql)
{ {
try { try {
$stmt = new Statement($statement, $this); $stmt = new Statement($sql, $this);
} catch (Throwable $ex) { } catch (Throwable $ex) {
throw DBALException::driverExceptionDuringQuery($this->_driver, $ex, $statement); throw DBALException::driverExceptionDuringQuery($this->_driver, $ex, $sql);
} }
$stmt->setFetchMode($this->defaultFetchMode); $stmt->setFetchMode($this->defaultFetchMode);
......
...@@ -372,10 +372,10 @@ class MasterSlaveConnection extends Connection ...@@ -372,10 +372,10 @@ class MasterSlaveConnection extends Connection
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function prepare($statement) public function prepare($sql)
{ {
$this->connect('master'); $this->connect('master');
return parent::prepare($statement); return parent::prepare($sql);
} }
} }
...@@ -15,11 +15,11 @@ interface Connection ...@@ -15,11 +15,11 @@ interface Connection
/** /**
* Prepares a statement for execution and returns a Statement object. * Prepares a statement for execution and returns a Statement object.
* *
* @param string $prepareString * @param string $sql
* *
* @return Statement * @return Statement
*/ */
public function prepare($prepareString); public function prepare($sql);
/** /**
* Executes an SQL statement, returning a result set as a Statement object. * Executes an SQL statement, returning a result set as a Statement object.
......
...@@ -128,9 +128,9 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar ...@@ -128,9 +128,9 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
/** /**
* {@inheritdoc} * {@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 ...@@ -104,9 +104,9 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
/** /**
* {@inheritdoc} * {@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 ...@@ -57,15 +57,15 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
} }
/** /**
* @param string $prepareString * @param string $sql
* @param array<int, int> $driverOptions * @param array<int, int> $driverOptions
* *
* @return \PDOStatement * @return \PDOStatement
*/ */
public function prepare($prepareString, $driverOptions = []) public function prepare($sql, $driverOptions = [])
{ {
try { try {
$statement = parent::prepare($prepareString, $driverOptions); $statement = parent::prepare($sql, $driverOptions);
assert($statement instanceof \PDOStatement); assert($statement instanceof \PDOStatement);
return $statement; return $statement;
......
...@@ -144,9 +144,9 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection ...@@ -144,9 +144,9 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection
/** /**
* {@inheritdoc} * {@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 ...@@ -113,9 +113,9 @@ class Connection extends \Doctrine\DBAL\Connection
* *
* @return Statement * @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); $stmt->setFetchMode($this->defaultFetchMode);
return $stmt; 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