mirror of
https://github.com/predis/predis.git
synced 2026-08-28 11:09:49 +00:00
Suppress PHP notices in Predis\ConnectionCluster::getConnectionById() if the specified connection alias/index does not exist.
This commit is contained in:
+2
-1
@@ -1295,7 +1295,8 @@ class ConnectionCluster implements IConnection, \IteratorAggregate {
|
||||
}
|
||||
|
||||
public function getConnectionById($id = null) {
|
||||
return $this->_pool[$id ?: 0];
|
||||
$alias = $id ?: 0;
|
||||
return isset($this->_pool[$alias]) ? $this->_pool[$alias] : null;
|
||||
}
|
||||
|
||||
public function getIterator() {
|
||||
|
||||
Reference in New Issue
Block a user