Example #1
0
 /**
  * Client constructor.
  * @param ConnectionInterface $connection
  * @param array $options
  */
 public function __construct(ConnectionInterface $connection, array $options = [])
 {
     $this->connection = $connection;
     $this->options = $options + static::$defaults;
     $this->connection->onReceive([$this, 'handleData']);
     if (!empty($this->options['password'])) {
         $this->sendCommand('password', $this->options['password']);
     }
 }