Remove useless helpers.

This commit is contained in:
Daniele Alessandri
2012-07-25 21:18:58 +02:00
parent 89d6c0e9b6
commit c3cafaa9a6
6 changed files with 17 additions and 48 deletions
+5 -3
View File
@@ -14,6 +14,7 @@ namespace Predis;
use Predis\Command\CommandInterface;
use Predis\Option\ClientOptionsInterface;
use Predis\Connection\ConnectionInterface;
use Predis\Connection\AggregatedConnectionInterface;
use Predis\Profile\ServerProfileInterface;
use Predis\Option\ClientOptions;
use Predis\Profile\ServerProfile;
@@ -187,9 +188,10 @@ class Client implements ClientInterface
public function getConnection($id = null)
{
if (isset($id)) {
if (!Helpers::isAggregated($this->connection)) {
$message = 'Retrieving connections by alias is supported only with aggregated connections (cluster or replication)';
throw new NotSupportedException($message);
if (!$this->connection instanceof AggregatedConnectionInterface) {
throw new NotSupportedException(
'Retrieving connections by alias is supported only with aggregated connections (cluster or replication)'
);
}
return $this->connection->getConnectionById($id);
}