Takes URI Params (foo=bar&key=value) and makes an associative array
out of them ["foo" => "bar", "key" => "value"]
@param string $uriParams
@return array
966600
public static function uriParams2Array(string $uriParams) : array
    {
        $stringUriParams = str_replace("?", "", $uriParams);
        $arrSingleParams = explode("&", $stringUriParams);
        
        $arrReturn = [];
        
        foreach ($arrSingleParams as $param) {
            $arrParam = explode("=", $param);
            $key = $arrParam[0];
            $val = '';
            if (isset($arrParam[1])) {
                $val = $arrParam[1];
            }
            $arrReturn[urldecode($key)] = urldecode($val);
        }
        return $arrReturn;
    }
657379
protected function parseUrlParams($url_params)
    {
        if ($url_params != '#' && (is_array($url_params) || (strpos($url_params, 'http') !== 0 && strpos($url_params, '/') !== 0))) {
            if (!is_array($url_params))
                $url_params = array($url_params);
            $url_to = Rails::application()->router()->urlFor($url_params, true);
        } else {
            $url_to = $url_params;
        }
        return $url_to;
    }
818704
public function get($uri, array $params = array())
    {

        $uri .= '?' . http_build_query($params);
        return $this->client->get($uri);

    }
65765
private function getUriParameters($uri)
    {
        $params = [];
        $pattern = '/\{([^\/]+)\}/';
        if (preg_match_all($pattern, $uri, $results) > 0) {
            foreach ($results[1] as $result) {
                $params[] = $result;
            }
        }
        return $params;
    }
1204681
private function makeUri($url, $params = array())
    {
        $uri = \GuzzleHttp\uri_template($this->endpoint, array_merge($this->defaults, $params));
        $uri = new Psr7\Uri($uri);

        // All arguments must be urlencoded (as per RFC 1738).
        $query = Psr7\build_query($params, PHP_QUERY_RFC1738);
        $uri = $uri->withQuery($query);

        return Psr7\Uri::withQueryValue($uri, 'url', $url);
    }
410070
public function uri($parameters = [], array $defaults = []): UriInterface
    {
        if (!$this->isCompiled()) {
            $this->compile();
        }

        $parameters = array_merge(
            $this->options,
            $defaults,
            $this->fetchOptions($parameters, $query)
        );

        foreach ($this->constrains as $key => $values) {
            if (empty($parameters[$key])) {
                throw new UriHandlerException("Unable to generate Uri, parameter `{$key}` is missing.");
            }
        }

        //Uri without empty blocks (pretty stupid implementation)
        $path = $this->interpolate($this->template, $parameters);

        //Uri with added prefix
        $uri = new Uri(($this->matchHost ? '' : $this->prefix) . trim($path, '/'));

        return empty($query) ? $uri : $uri->withQuery(http_build_query($query));
    }
89122
public function serializeParams($params) {
		$serialized = '';
		foreach ($params as $key => $val) {
			$serialized .= $key;
			if (is_bool($val) === true) {
				$serialized .= '=' . $val ? $this->options['param-true'] : $this->options['param-false'];
			} else if ($val != '') {
				$serialized .= '=' . $val;
			}
			$serialized .= $this->options['param-delimiter'];
		}
		return $serialized;
	}
1113532
public static function create(array $aParams = null)
    {
        $params = new self();
        if ($aParams === null) {
            return $params;
        }

        foreach ($aParams as $name => $value) {
            $params->$name = $value;
        }

        return $params;
    }
671105
protected function addRequestVariablesToUrlParameters(array $urlParameters)
    {
        $urlParameters = parent::addRequestVariablesToUrlParameters($urlParameters);
        $urlParameters['name'] = $this->simplePageName;
        
        return $urlParameters;
    }
592680
private static function getResponse(string $uri, array $params = []): array
    {
        self::initialize();

        if (empty($params)) {
            $response = self::$client->get('api/' . self::$version . '/' . $uri);
        } else {
            $response = self::$client->post('api/' . self::$version . '/' . $uri, [
                'form_params' => $params,
            ]);
        }

        return json_decode($response->getBody(), TRUE);
    }
33605
private function toArray($params) {
		if(is_array($params)) {
			return $params;
		}
		if(is_object($params)) {
			return ArrayHelper::toArray($params);
		}
		throw new InvalidMethodParameterException;
	}
1062530
protected function addRequestVariablesToUrlParameters(array $urlParameters)
    {
        foreach ($this->getAddRequestVariables() as $key)
        {
            $urlParameters[$key] = $this->getRequest()->get($key);
        }
        foreach ($this->getSetRequestVariables() as $key => $value)
        {
            $urlParameters[$key] = $value;
        }

        return $urlParameters;
    }
658504
protected function prepareParams(array $params)
    {
        foreach ($params as $key => $param) {
            if (gettype($param) === 'boolean') {
                $params[$key] = (string)(($param) ? 'true' : 'false');
            }
        }
        return $params;
    }
438393
private function buildDirectiveParameters($parameters = array())
    {
        $result = array();

        foreach ($parameters as $key => $value) {
            $result[] = $key.'="'.$value.'"';
        }

        return implode(',', $result);
    }
582146
private function getToBasketLinkOtherParameters($aParameters = array())
    {
        $aExcludeParameters = TCMSSmartURLData::GetActive()->getSeoURLParameters();

        foreach ($aParameters as $sKey => $sVal) {
            $aExcludeParameters[] = $sKey;
        }

        // now add all OTHER parameters
        $aOtherParameters = TGlobal::instance()->GetUserData(null, $aExcludeParameters);
        foreach ($aOtherParameters as $sKey => $sVal) {
            $aParameters[$sKey] = $sVal;
        }

        return $aParameters;
    }
82760
private function getUriRegexFromParameters($uri, $params)
    {
        $regex = str_replace('/', '\/', $uri);
        foreach ($params as $param) {
            $regex = str_replace('{' . $param . '}', '([^\/]+)', $regex);
        }
        return $regex;
    }
1249147
protected function _parseApiParams($params)
  {
    $apiparams = [];
    if (count($params) === 0) {
      return $apiparams;
    }

    if (is_array($params[0])) {
      // given parameters are array
      $apiparams = $params[0];
      return $apiparams;
    }

    // user gave us query-style params
    parse_str($params[0], $apiparams);
    if (! is_array($apiparams)) {
      $apiparams = [];
    }

    return $apiparams;
  }