src/Cluster/Distributor/HashRing.php
public function add($node, $weight = null)
    {
        // In case of collisions in the hashes of the nodes, the node added
        // last wins, thus the order in which nodes are added is significant.
        $this->nodes[] = array(
            'object' => $node,
            'weight' => (int) $weight ?: $this::DEFAULT_WEIGHT,
        );

        $this->reset();
    }
public function add($node, $weight = null)
    {
        // In case of collisions in the hashes of the nodes, the node added
        // last wins, thus the order in which nodes are added is significant.
        $this->nodes[] = array(
            'object' => $node,
            'weight' => (int) $weight ?: $this::DEFAULT_WEIGHT,
        );

        $this->reset();
    }
public function add ( $ node , $ weight = null ) { // In case of collisions in the hashes of the nodes, the node added // last wins, thus the order in which nodes are added is significant. $ this -> nodes [ ] = array ( 'object' => $ node , 'weight' => ( int ) $ weight ? : $ this :: DEFAULT_WEIGHT , ) ; $ this -> reset ( ) ; }
Adds a node to the ring with an optional weight.

@param mixed $node   Node object.
@param int   $weight Weight for the node.
Adds a node to the ring with an optional weight .