src/Redis/Cluster/Native.php
public function getConnectionBySlot($slot)
    {
        if ($slot < 0x0000 || $slot > 0x3FFF) {
            throw new \OutOfBoundsException("Invalid slot [$slot].");
        }

        if (isset($this->slots[$slot])) {
            return $this->slots[$slot];
        }

        $connectionID = $this->guessNode($slot);
        if (!$connection = $this->getConnectionById($connectionID)) {
            $connection = $this->createConnection($connectionID);
        }

        return $this->slots[$slot] = $connection;
    }
public function getConnectionBySlot($slot)
    {
        if ($slot < 0x0000 || $slot > 0x3FFF) {
            throw new \OutOfBoundsException("Invalid slot [$slot].");
        }

        if (isset($this->slots[$slot])) {
            return $this->slots[$slot];
        }

        $connectionID = $this->guessNode($slot);
        if (!$connection = $this->getConnectionById($connectionID)) {
            $connection = $this->createConnection($connectionID);
        }

        return $this->slots[$slot] = $connection;
    }
public function getConnectionBySlot ( $ slot ) { if ( $ slot < 0x0000 || $ slot > 0x3FFF ) { throw new \ OutOfBoundsException ( "Invalid slot [$slot]." ) ; } if ( isset ( $ this -> slots [ $ slot ] ) ) { return $ this -> slots [ $ slot ] ; } $ connectionID = $ this -> guessNode ( $ slot ) ; if ( ! $ connection = $ this -> getConnectionById ( $ connectionID ) ) { $ connection = $ this -> createConnection ( $ connectionID ) ; } return $ this -> slots [ $ slot ] = $ connection ; }
Returns the connection currently associated to a given slot.

@param int $slot Slot index.

@return Client|mixed|null
@throws RedisException
Returns the connection currently associated to a given slot .