Skip to content

Commit

Permalink
[doctrineGH-3595] Trigger deprecation messages for Sharding APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Mar 6, 2021
1 parent 38ad6ba commit 3f0e898
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Doctrine/DBAL/Sharding/PoolingShardManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Sharding;

use Doctrine\DBAL\Sharding\ShardChoser\ShardChoser;
use Doctrine\Deprecations\Deprecation;
use RuntimeException;

/**
Expand All @@ -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'];
Expand Down
7 changes: 7 additions & 0 deletions lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 3f0e898

Please sign in to comment.