Issue #3174848 by alexpott: Fix typo in Connection::prepare deprecation message

merge-requests/25/head
Lee Rowlands 2020-10-12 17:13:52 +10:00
parent 563ed8e8d3
commit eaf33de13e
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
3 changed files with 4 additions and 4 deletions

View File

@ -1736,13 +1736,13 @@ abstract class Connection {
* *
* @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database
* drivers should instantiate \PDOStatement objects by calling * 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. * \PDO::prepare should not be called outside of driver code.
* *
* @see https://www.drupal.org/node/3137786 * @see https://www.drupal.org/node/3137786
*/ */
public function prepare($statement, array $driver_options = []) { 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); return $this->connection->prepare($statement, $driver_options);
} }

View File

@ -349,7 +349,7 @@ class Connection extends DatabaseConnection {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function prepare($statement, array $driver_options = []) { 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); return new Statement($this->connection, $this, $statement, $driver_options);
} }

View File

@ -17,7 +17,7 @@ class DatabaseExceptionWrapperTest extends KernelTestBase {
* Tests deprecation of Connection::prepare. * Tests deprecation of Connection::prepare.
* *
* @group legacy * @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() { public function testPrepare() {
$connection = Database::getConnection(); $connection = Database::getConnection();