Returns the parameters used by the html client.

@param array $params Associative list of all parameters
@param array $prefixes List of prefixes the parameters must start with
@return array Associative list of parameters used by the html client
334245
protected function getClientParams( array $params, array $prefixes = array( 'f', 'l', 'd', 'a' ) )
	{
		$list = [];

		foreach( $params as $key => $value )
		{
			if( in_array( $key[0], $prefixes ) && $key[1] === '_' ) {
				$list[$key] = $value;
			}
		}

		return $list;
	}
658504
protected function prepareParams(array $params)
    {
        foreach ($params as $key => $param) {
            if (gettype($param) === 'boolean') {
                $params[$key] = (string)(($param) ? 'true' : 'false');
            }
        }
        return $params;
    }
870339
protected function formatKVLists(array $params)
    {
        $formatted = [];

        foreach ($params as $name => $value) {
            $formatted[] = [
                'key' => $name,
                'value' => strval($value),
            ];
        }

        return $formatted;
    }
748927
protected function getHeaders($params)
    {
        $headers = array();
        
        foreach ($params as $name => $value) {
            if (substr($name, 0, 5) === 'HTTP_') {
                $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
                $headers[$key] = $value;
            }
        }
        
        return $headers;
    }
1270889
private function buildParams($params)
    {
        $keys = is_array($params) ? $params : func_get_args();

        $array = [];

        foreach ($keys as $key) {
            if (property_exists($this, $key))
                $array = array_merge($array, [$key => $this->$key]);
        }

        return $array;
    }
1294939
public function transformParams(array $params): array
    {
        $newParams = [];
        foreach ($params as $key => $value) {
            $newParams['%' . $key . '%'] = $value;
        }

        return $newParams;
    }
172920
protected function getAccessTokenUrl(array $params)
    {
        $url = $this->getBaseAccessTokenUrl($params);

        if ($this->getAccessTokenMethod() === self::METHOD_GET) {
            $query = $this->getAccessTokenQuery($params);
            return $this->appendQuery($url, $query);
        }

        return $url;
    }
1163808
private function getDateParams($params)
    {
        /**
         * @var \DateTime
         */
        $to = $this->dateContext;
        /**
         * @var \DateTime
         */
        $from = clone $to;
        $from->sub(new \DateInterval('PT4M'));
        $from->sub(new \DateInterval('PT59S'));

        $params['dateFrom'] = $from->format('Y-m-d H:i:s');

        $params['dateTo'] = $to->format('Y-m-d H:i:s');

        return $params;
    }
285728
private static function getParamsToSign(
        array $params,
        array $ignoreParamKeys = [],
        int $currentLevel = 1,
        string $prefix = ''
    ): array
    {
        $paramsToSign = [];
        foreach ($params as $key => $value) {
            if ((in_array($key, $ignoreParamKeys) && $currentLevel == 1)) {
                continue;
            }
            $paramKey = ($prefix ? $prefix . ':' : '') . $key;
            if (is_array($value)) {
                if ($currentLevel >= self::MAXIMUM_RECURSION_DEPTH) {
                    $paramsToSign[$paramKey] = (string)$paramKey.':';
                } else {
                    $subArray = self::getParamsToSign($value, $ignoreParamKeys, $currentLevel + 1, $paramKey);
                    $paramsToSign = array_merge($paramsToSign, $subArray);
                }
            } else {
                if (is_bool($value)) {
                    $value = $value ? '1' : '0';
                } else {
                    $value = (string)$value;
                }
                $paramsToSign[$paramKey] = (string)$paramKey.':'.$value;
            }
        }
        if ($currentLevel == 1) {
            ksort($paramsToSign, SORT_NATURAL);
        }
        return $paramsToSign;
    }
500037
public static function parseArray(array $params): array
    {
        $args = $sOpts = $lOpts = [];

        foreach ($params as $key => $val) {
            if (\is_int($key)) { // as argument
                $args[$key] = $val;
                continue;
            }

            $cleanKey = \trim((string)$key, '-');

            if ('' === $cleanKey) { // as argument
                $args[] = $val;
                continue;
            }

            if (0 === \strpos($key, '--')) { // long option
                $lOpts[$cleanKey] = $val;
            } elseif (0 === \strpos($key, '-')) { // short option
                $sOpts[$cleanKey] = $val;
            } else {
                $args[$key] = $val;
            }
        }

        return [$args, $sOpts, $lOpts];
    }
278950
private function parseResizeParams(array $params = []): array
    {
        $resizeParams = [];
        foreach ($params as $param) {
            \preg_match('/^('.\implode('|', $this->allowedResizeParams).')([0-9]+)$/', $param, $matches);
            if (isset($matches[1]) && isset($matches[2])) {
                $resizeParams[$matches[1]] = (int)$matches[2];

                if ($matches[1] == 'gs') {
                    $resizeParams[$matches[1]] = ((int)$matches[2] === 1);
                }
            }
        }
        return $resizeParams;
    }
424908
protected function mapUriPartsFromServerParams(array $params)
    {
        $parts = [];
        
        $map = [
            'PHP_AUTH_USER' => 'user',
            'PHP_AUTH_PWD' => 'password',
            'HTTP_HOST' => 'host',
            'SERVER_PORT' => 'port',
            'REQUEST_URI' => 'path',
            'QUERY_STRING' => 'query'
        ];
        
        foreach ($map as $param => $key) {
            if (isset($params[$param])) {
                $parts[$key] = $params[$param];
            }
        }
        
        return $parts;
    }
340016
protected function getHeader(array $params)
	{
		// Prepare the function's header
		$header = "/**\n";
		foreach ($params as $paramName => $paramType)
		{
			$header .= '* @param {' . $paramType . '} ' . $paramName . "\n";
		}
		$header .= "*/\n";

		return $header;
	}
369612
protected function parseRelationshipParams(array $params): array
    {
        if (empty($params)) {
            return [];
        }
        $parsed = [];
        foreach ($params as $key => $value) {
            # loop through
            if (is_int($key)) {
                $parsed[$key] = '';
                continue;
            }
            if ($key !== 'paginate' || ($key === 'paginate' && !Arr::isAssoc($value))) {
                $key = $key === 'paginate' ? 'limit' : $key;
                $parsed[$key] = implode('|', $value);

            } else {
                $limit = $this->findInArray($value, 'limit', 0, 10);
                $offset = $this->findInArray($value, 'offset', 1, 0);
                $parsed['limit'] = $limit . '|' . $offset;
            }
        }
        return $parsed;
    }
225872
private function getAuthParams($prefix)
    {
        return array_intersect_key($this->params, array_flip($this->addPrefix($this->auth, $prefix)));
    }
415727
private function getRouteParam($route, $param)
    {
        $route = (array) $route;
        $prefix = chr(0).'*'.chr(0);
        
        return $this->arrayGet(
            $route, 
            $prefix.$param, 
            $this->arrayGet($route, $param)
        );
    }
450420
private static function getParamValues($params, $inputs) {
        foreach ($params as $key => $param) {
            if (preg_match("#^:([\[\]a-zA-Z0-9_]+)$#", $param, $param_type)) {
                $params[$key] = @$inputs[(string) $param_type[1]];
            }
        }
        return $params;
    }