src/SlavePool.php
public function add(Slave $slave)
    {
        $port = $slave->getPort();

        if (isset($this->slaves[$port])) {
            throw new \Exception("Slave port $port already occupied.");
        }

        if ($slave->getPort() !== $port) {
            throw new \Exception("Slave mis-assigned.");
        }

        $this->slaves[$port] = $slave;
    }
public function add(Slave $slave)
    {
        $port = $slave->getPort();

        if (isset($this->slaves[$port])) {
            throw new \Exception("Slave port $port already occupied.");
        }

        if ($slave->getPort() !== $port) {
            throw new \Exception("Slave mis-assigned.");
        }

        $this->slaves[$port] = $slave;
    }
public function add ( Slave $ slave ) { $ port = $ slave -> getPort ( ) ; if ( isset ( $ this -> slaves [ $ port ] ) ) { throw new \ Exception ( "Slave port $port already occupied." ) ; } if ( $ slave -> getPort ( ) !== $ port ) { throw new \ Exception ( "Slave mis-assigned." ) ; } $ this -> slaves [ $ port ] = $ slave ; }
Add slave to pool

Slave is in CREATED state

@param Slave $slave

@return void
Add slave to pool