From a6cb2ccc98782eba274b4db55d667c8347073b75 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 6 Mar 2021 18:21:41 +0100 Subject: [PATCH] [GH-4054] Convert MasterSlaveConnection to Doctrine deprecations API. --- .../Connections/MasterSlaveConnection.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php index 0d5994e39ac..ccbcff31892 100644 --- a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php +++ b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php @@ -5,13 +5,9 @@ use Doctrine\Common\EventManager; use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Driver; +use Doctrine\Deprecations\Deprecation; use InvalidArgumentException; -use function sprintf; -use function trigger_error; - -use const E_USER_DEPRECATED; - /** * @deprecated Use PrimaryReadReplicaConnection instead * @@ -94,13 +90,12 @@ public function connect($connectionName = null) private function deprecated(string $thing, string $instead): void { - @trigger_error( - sprintf( - '%s is deprecated since doctrine/dbal 2.11 and will be removed in 3.0, use %s instead.', - $thing, - $instead - ), - E_USER_DEPRECATED + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4054', + '%s is deprecated since doctrine/dbal 2.11 and will be removed in 3.0, use %s instead.', + $thing, + $instead ); } }