Elastica\Connection::__construct PHP Method

__construct() public method

Creates a new connection object. A connection is enabled by default.
public __construct ( array $params = [] )
$params array OPTIONAL Connection params: host, port, transport, timeout. All are optional
    public function __construct(array $params = [])
    {
        $this->setParams($params);
        $this->setEnabled(true);
        // Set empty config param if not exists
        if (!$this->hasParam('config')) {
            $this->setParam('config', []);
        }
    }