@param \Elastica\Connection|array $params Params to create a connection

@throws Exception\InvalidException

@return self
516100
public static function create($params = [])
    {
        if (\is_array($params)) {
            return new self($params);
        }

        if ($params instanceof self) {
            return $params;
        }

        throw new InvalidException('Invalid data type');
    }
539602
public function remove($params = [])
    {
        $this->params = array_diff_key($this->params, array_fill_keys($params, ''));
        return $this;
    }
1320992
public function create(array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::CREATE,
            $params,
            null
        );
    }
1195154
public function execute(array $params = [])
    {
        $this->formatSqlByParams($params);
        $result = $this->connection->query($this->sql);
        if ($result === false) {
            throw new MysqlException('Mysql execute error，connectError=' . $this->connection->connect_error . ' error=' . $this->connection->error);
        }

        $this->pushSqlToStack($this->sql);

        return $result;
    }
1275446
public function create($params)
    {
        Util::verifyKeys(self::createSignature(), $params);

        $file = $params['file'];

        if (!is_resource($file)) {
            throw new InvalidArgumentException('file must be a stream resource');
        }

        $payload = [
            'document_upload[kind]' => $params['kind']
        ];
        $path = $this->_config->merchantPath() . '/document_uploads/';
        $response = $this->_http->postMultipart($path, $payload, $file);

        if (isset($response['apiErrorResponse'])) {
            return new Result\Error($response['apiErrorResponse']);
        }

        if (isset($response['documentUpload'])) {
            $documentUpload = DocumentUpload::factory($response['documentUpload']);
            return new Result\Successful($documentUpload);
        }
    }
1371344
public function create(array $params = array())
    {
        $defaults = array(
            'name'      => null,
            'devurl'    => null,
            'is_active' => true,
            'is_public' => false,
        );

        $params = array_filter(
            array_merge($defaults, $params),
            array($this, 'isNotNull')
        );

        if(
            !isset($params['name'])
         || !isset($params['devurl'])
        ) {
            throw new \Exception('Missing mandatory parameters');
        }
        $data = array('project'=>$params);

        return $this->post('/projects.json', $data);
    }
1174186
public function withServerParams(array $params)
    {
        $request = $this->copy();
        $request->serverParams = $params;
        
        $request->reset();
        
        return $request;
    }
726073
public function setParams(array $params = [])
    {

        //Process Params
        $params = $this->processParams($params);

        //Set the params
        $this->params = $params;

        return $this;
    }
361314
public function open(array $params = array())
	{
		$url = $this->getAbsoluteUrl($params);

		if ( !$url ) {
			throw new PageException('Page url not specified', PageException::TYPE_EMPTY_URL);
		}

		$this->pageFactory->getSession()->visit($url);

		return $this;
	}
10321
public function bind($params = null)
    {

        if (is_array($params)) {
            foreach ($params as $k => $v) {
                $this->bindParam($k, $v);
            }
        }

        return $this;
    }
471132
public function withPost(array $params)
    {
        $request = $this;
        if ($this->isJson()) {
            $body = json_encode($params);
        } else {
            $body = http_build_query($params);
            if (!$this->hasHeader('Content-Type')) {
                $request = $this->withHeader('Content-Type', 'application/x-www-form-urlencoded');
            }
        }

        return new self(
            $request->getMethod(),
            $request->getUri(),
            $request->getHeaders(),
            $body,
            $request->getProtocolVersion(),
            $request->getRetries(),
            $request->getOptions(),
            $this->getServiceKey(),
            $this->getRequestKey()
        );
    }
199837
public function createPdoConnection(array $params = null)
    {
        if (!isset($params)) {
            $params = $this->getConfig()->get('database');
        }

        $platform = !empty($params['platform']) ? strtolower($params['platform']) : 'mysql';
        $port = empty($params['port']) ? '' : ';port=' . $params['port'];
        $dbname = empty($params['dbname']) ? '' : ';dbname=' . $params['dbname'];

        $options = array();

        if (isset($params['sslCA'])) {
            $options[PDO::MYSQL_ATTR_SSL_CA] = $params['sslCA'];
        }
        if (isset($params['sslCert'])) {
            $options[PDO::MYSQL_ATTR_SSL_CERT] = $params['sslCert'];
        }
        if (isset($params['sslKey'])) {
            $options[PDO::MYSQL_ATTR_SSL_KEY] = $params['sslKey'];
        }
        if (isset($params['sslCAPath'])) {
            $options[PDO::MYSQL_ATTR_SSL_CAPATH] = $params['sslCAPath'];
        }
        if (isset($params['sslCipher'])) {
            $options[PDO::MYSQL_ATTR_SSL_CIPHER] = $params['sslCipher'];
        }

        $dsn = $platform . ':host='.$params['host'].$port.$dbname;
        $dbh = new \PDO($dsn, $params['user'], $params['password'], $options);

        return $dbh;
    }
882711
public function create(array $params)
    {
        if (!array_key_exists('amount', $params) ||
            !array_key_exists('currency', $params) ||
            !array_key_exists('description', $params) ||
            !array_key_exists('order_id', $params) ||
            !array_key_exists('payment_options', $params) ||
            !array_key_exists('type', $params)
        ) {
            throw new \InvalidArgumentException('Invalid data provided.');
        }

        return $this->post('/orders', [], $params);
    }
1246861
public function setParams($params) {
        if (!is_array($params)) {
            throw new \InvalidArgumentException('Paramater $params must be an array.');
        }

        foreach ($params as $name => $value) {
            if (isset($this->params[$name]) || array_key_exists($name, $this->params)) {
                if (is_array($this->params[$name])) {
                    if (is_array($value)) {
                        $this->params[$name] = array_merge($this->params[$name], $value);
                    }
                    else {
                        throw new ConfigurationException(sprintf('Parameters type mismatch. Given type is "%s", expected type is "%s"', gettype($this->params[$name]) ,gettype($value)));
                    }
                }
                else {
                    $this->params[$name] = $value;
                }
            }
            else {
                throw new ConfigurationException(sprintf('Parameter "%s" doesn\'t exists', $name));
            }
        }
    }
1278520
public static function create(array $params)
  {
    $create = R::dispense(self::classRefactor(get_called_class()));
    foreach ($params as $param => $value) {
      $create->$param = $value;
    }
    $create->created_at = time();
    $create->updated_at = time();
    R::store($create);
  }
603064
public static function fromSuccess(array $params)
    {
        $matchResult = new self();
        $matchResult->type = 'success';
        $matchResult->params = $params;
        return $matchResult;
    }
1000757
private function validateAndSetBotParams(array $params): self
    {
        $this->validateAndSetBotParamsVital($params);
        $this->validateAndSetBotParamsSpecial($params);
        $this->validateAndSetBotParamsExtra($params);

        return $this;
    }