Issue #3174848 by alexpott: Fix typo in Connection::prepare deprecation message
parent
563ed8e8d3
commit
eaf33de13e
|
@ -1736,13 +1736,13 @@ abstract class Connection {
|
|||
*
|
||||
* @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database
|
||||
* drivers should instantiate \PDOStatement objects by calling
|
||||
* \PDO::prepare in their Collection::prepareStatement method instead.
|
||||
* \PDO::prepare in their Connection::prepareStatement method instead.
|
||||
* \PDO::prepare should not be called outside of driver code.
|
||||
*
|
||||
* @see https://www.drupal.org/node/3137786
|
||||
*/
|
||||
public function prepare($statement, array $driver_options = []) {
|
||||
@trigger_error('Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Collection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786', E_USER_DEPRECATED);
|
||||
@trigger_error('Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Connection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786', E_USER_DEPRECATED);
|
||||
return $this->connection->prepare($statement, $driver_options);
|
||||
}
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ class Connection extends DatabaseConnection {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function prepare($statement, array $driver_options = []) {
|
||||
@trigger_error('Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Collection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786', E_USER_DEPRECATED);
|
||||
@trigger_error('Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Connection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786', E_USER_DEPRECATED);
|
||||
return new Statement($this->connection, $this, $statement, $driver_options);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class DatabaseExceptionWrapperTest extends KernelTestBase {
|
|||
* Tests deprecation of Connection::prepare.
|
||||
*
|
||||
* @group legacy
|
||||
* @expectedDeprecation Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Collection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786
|
||||
* @expectedDeprecation Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Connection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786
|
||||
*/
|
||||
public function testPrepare() {
|
||||
$connection = Database::getConnection();
|
||||
|
|
Loading…
Reference in New Issue