Prepare parameters for API requests, ensuring the mandatory requirments are satisfied

@param array $params
502585
public function prepare($params)
    {
        $this->params = !empty($params) ? $params[ 0 ] : [ ];

        // force mandatory fields
        $this->filter();
        $this->maxRecords();
    }
726073
public function setParams(array $params = [])
    {

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

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

        return $this;
    }
943028
protected function setQueryParams(array $params)
    {
        foreach ($params as $key => $value) {
            $this->setQueryParam($key, $value);
        }
    }
508603
protected function processParams(array $params)
    {
        //If a file needs to be uploaded
        if (isset($params['file']) && $params['file'] instanceof BoxFile) {
            //Set the file property
            $this->setFile($params['file']);
            //Remove the file item from the params array
            unset($params['file']);
        }

        //Whether the response needs to be validated
        //against being a valid JSON response
        if (isset($params['validateResponse'])) {
            //Set the validateResponse
            $this->validateResponse = $params['validateResponse'];
            //Remove the validateResponse from the params array
            unset($params['validateResponse']);
        }

        return $params;
    }
947764
public function create(array $params = array())
    {
        $this->validateRequiredParameters(array('idList', 'name'), $params);

        if (!array_key_exists('due', $params)) {
            $params['due'] = null;
        }
        if (!array_key_exists('urlSource', $params)) {
            $params['urlSource'] = null;
        }

        return $this->post($this->getPath(), $params);
    }
1315639
private function validateAndSetBotParamsExtra(array $params)
    {
        foreach (self::$valid_extra_bot_params as $extra_key) {
            if (!array_key_exists($extra_key, $params)) {
                continue;
            }

            $this->bot_params[$extra_key] = $params[$extra_key];
        }
    }
202340
private static function _checkParams(array $params) : void
    {
        // check existence of mandatory parameters

        // driver
        if (! isset($params['driver']) && ! isset($params['driverClass'])) {
            throw DBALException::driverRequired();
        }

        // check validity of parameters

        // driver
        if (isset($params['driver']) && ! isset(self::$_driverMap[$params['driver']])) {
            throw DBALException::unknownDriver($params['driver'], array_keys(self::$_driverMap));
        }

        if (isset($params['driverClass']) && ! in_array(Driver::class, class_implements($params['driverClass'], true))) {
            throw DBALException::invalidDriverClass($params['driverClass']);
        }
    }
798571
public function setParams(array $params = array())
    {
        foreach ($params as $key => $value) {
            if (null != $value) {
                $this->$key = $value;
            }
        }

        return $this;
    }
943927
public static function prepare($params = [])
    {
        $positions = array_combine(array_keys($params), array_fill(0, count($params), 0));
        $data = [];

        do {
            $data[] = self::getByIndexes($params, $positions);
        } while (self::updateIndexesToNextIteration($params, $positions));

        return $data;
    }
865052
private function assertReqParameters($keys, $params = null)
    {
        if (!empty($keys['args']['req'])) {
            if (!$params) {
                $msg = 'No parameters provided. (HINT: Reference the $keys '
                     . 'property at the top of the API class file for '
                     . 'required and optional parameters.)';
                throw new ApiException($msg);
            }

            foreach ($keys['args']['req'] as $k) {
                if (!isset($params[$k])) {
                    $msg = 'Required parameter `'.$k.'` not provided. '
                         . '(HINT: Reference the $keys '
                         . 'property at the top of the API class file for '
                         . 'required and optional parameters.)';
                    throw new ApiException($msg);
                }
            }
        }
    }
506889
protected function setParams(array $params) {
		parent::setParams($params);
		$ref = $this->relative ? str_replace('(%s)://', '(?:(%s)://)?', $this->ref) : $this->ref;
		$this->ref = sprintf($ref, implode('|', $this->protocols));
	}
470512
private function resetParams($params)
    {
        $keys = is_array($params) ? $params : func_get_args();

        foreach ($keys as $key) {
            if (property_exists($this, $key))
                $this->$key = null;
        }
    }
1239721
protected function setParams($params)
    {
        $this->params = $this->default_params;
        foreach ($params as $name => $value) {
            $method = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($name))));
            if (!method_exists($this, $method)) {
                throw new Exception\InvalidArgumentException(__METHOD__ . " Parameter '$name' does not exists.");
            }
            $this->$method($value);
        }
    }
1276598
private function formatSqlByParams(array $params)
    {
        if (empty($params)) {
            return;
        }
        foreach ($params as $key => $value) {
            $this->sql .= " $key=" . $value;
        }
    }
57694
protected function validateParams(array $params)
    {
        foreach ($params as $param) {
            if (!$this->hasRequestParameter($param)) {
                throw new common_exception_MissingParameter($param .' is missing from the request.', $this->getRequestURI());
            }

            if (empty($this->getRequestParameter($param))) {
                throw new common_exception_ValidationFailed($param, $param .' cannot be empty');
            }
        }
    }
1087657
public function setParams($params)
    {
        if (!empty($params)) {
            foreach ($params as $key => $value) {
                $this->options[ 'json' ][ $key ] = $value;
            }
        }
        return $this;
    }
738586
protected function prepare(string $query, array $params): array
	{
		// Prepare query and parameters

		[$query, $params] = $this->prepareQueryAndParams($query, $params);

		// Create prepared statement

		try
		{
			prepare:

			$statement = $this->pdo->prepare($query);
		}
		catch(PDOException $e)
		{
			if($this->isConnectionLostAndShouldItBeReestablished())
			{
				$this->reconnect();

				goto prepare;
			}

			throw new PDOException($e->getMessage() . ' [ ' . $this->prepareQueryForLog($query, $params) . ' ] ', (int) $e->getCode(), $e->getPrevious());
		}

		// Bind parameters

		foreach($params as $key => $value)
		{
			$this->bindParameter($statement, $key, $value);
		}

		// Return query, parameters and the prepared statement

		return ['query' => $query, 'params' => $params, 'statement' => $statement];
	}