From 3f0e89807ef25c3890dcac6ed7480169af23f290 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 7 Mar 2021 00:00:57 +0100 Subject: [PATCH] [GH-3595] Trigger deprecation messages for Sharding APIs. --- lib/Doctrine/DBAL/Sharding/PoolingShardManager.php | 7 +++++++ .../DBAL/Sharding/SQLAzure/SQLAzureShardManager.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php b/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php index 81a197ee117..739cfaba6e1 100644 --- a/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php +++ b/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php @@ -3,6 +3,7 @@ namespace Doctrine\DBAL\Sharding; use Doctrine\DBAL\Sharding\ShardChoser\ShardChoser; +use Doctrine\Deprecations\Deprecation; use RuntimeException; /** @@ -23,6 +24,12 @@ class PoolingShardManager implements ShardManager public function __construct(PoolingShardConnection $conn) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3595', + 'Native Sharding support in DBAL is removed without replacement.' + ); + $params = $conn->getParams(); $this->conn = $conn; $this->choser = $params['shardChoser']; diff --git a/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php b/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php index d511553c155..83ad879f293 100644 --- a/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php +++ b/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Sharding\ShardingException; use Doctrine\DBAL\Sharding\ShardManager; use Doctrine\DBAL\Types\Type; +use Doctrine\Deprecations\Deprecation; use RuntimeException; use function sprintf; @@ -40,6 +41,12 @@ class SQLAzureShardManager implements ShardManager */ public function __construct(Connection $conn) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3595', + 'Native Sharding support in DBAL is removed without replacement.' + ); + $this->conn = $conn; $params = $conn->getParams();