src/Connection/Aggregate/SentinelReplication.php
protected function assertConnectionRole(NodeConnectionInterface $connection, $role)
    {
        $role = strtolower($role);
        $actualRole = $connection->executeCommand(RawCommand::create('ROLE'));

        if ($role !== $actualRole[0]) {
            throw new RoleException($connection, "Expected $role but got $actualRole[0] [$connection]");
        }
    }
protected function assertConnectionRole(NodeConnectionInterface $connection, $role)
    {
        $role = strtolower($role);
        $actualRole = $connection->executeCommand(RawCommand::create('ROLE'));

        if ($role !== $actualRole[0]) {
            throw new RoleException($connection, "Expected $role but got $actualRole[0] [$connection]");
        }
    }
protected function assertConnectionRole ( NodeConnectionInterface $ connection , $ role ) { $ role = strtolower ( $ role ) ; $ actualRole = $ connection -> executeCommand ( RawCommand :: create ( 'ROLE' ) ) ; if ( $ role !== $ actualRole [ 0 ] ) { throw new RoleException ( $ connection , "Expected $role but got $actualRole[0] [$connection]" ) ; } }
Asserts that the specified connection matches an expected role.

@param NodeConnectionInterface $connection Connection to a redis server.
@param string                  $role       Expected role of the server ("master", "slave" or "sentinel").

@throws RoleException
Asserts that the specified connection matches an expected role .