Predis\Connection\Replication\SentinelReplication::add PHP Метод

add() публичный Метод

public add ( Predis\Connection\NodeConnectionInterface $connection )
$connection Predis\Connection\NodeConnectionInterface
    public function add(NodeConnectionInterface $connection)
    {
        $parameters = $connection->getParameters();
        if ('master' === ($role = $parameters->role)) {
            $this->master = $connection;
        } elseif ('sentinel' === $role) {
            $this->sentinels[] = $connection;
            // sentinels are not considered part of the pool.
            return;
        } else {
            // everything else is considered a slave.
            $this->slaves[] = $connection;
        }
        $this->pool[(string) $connection] = $connection;
        $this->reset();
    }