Parse Parameters
@param $param
@return array
974532
protected static function parseParameters($param)
    {
        $result = array();
        $parts = explode('=', trim($param));
        $key = array_shift($parts);
        while (!empty($parts)) {
            $value = array_shift($parts);
            while (('"' == $value{0} || "'" == $value{0}) && false == strrpos($value, $value{0}) && !empty($parts)) {
                $value .= '=' . array_shift($parts);
            }
            if (!empty($value) && !empty($parts) && $pos = strrpos($value, ' ')) {
                $result[$key] = self::__compileVar(trim(substr($value, 0, $pos), '\'"'));
                $key = substr($value, $pos + 1);
            } else {
                $result[$key] = self::__compileVar(trim($value, '\'"'));
            }
        }

        return $result;
    }
1273020
public static function getParameter($param)
    {
        $lexer = new Lexer('(' . $param . ')');

        // A dummy parser is used for error reporting.
        $param = ParameterDefinition::parse(new Parser(), $lexer->list);

        if (empty($param[0])) {
            return [
                '',
                '',
                '',
                '',
                '',
            ];
        }

        $param = $param[0];

        $options = [];
        foreach ($param->type->options->options as $opt) {
            $options[] = is_string($opt) ? $opt : $opt['value'];
        }

        return [
            empty($param->inOut) ? '' : $param->inOut,
            $param->name,
            $param->type->name,
            implode(',', $param->type->parameters),
            implode(' ', $options),
        ];
    }
865054
public function actionParse($param)
    {
        $model = new ParseForm();
        $model->kadastr = $param;
        $data = $model->parse();

        echo $this->render('parse',['data'=>$data]);
    }
351316
public static function setParams(&$param)
    {
        $arr_req = array();
        foreach($param as $key=>$value){
            if(is_array($value)) {
                $arr_req[] = "${key}=".implode("&",$value);
            } else {
                if ($value == '') {
                    continue;
                }
                $arr_req[] = "${key}=${value}";
            }
        }
        $str = implode("&",$arr_req);

        return $str;
    }
59770
public function get_parameters($param=null)
    {
        $params = $this->params;
        $params['MAILBOX'] = $this->mailbox;
        $params['ORDER']   = $this->order;

        if ($param !== null) {
            return $params[$param];
        }

        return $params;
    }
1359049
public function getParam($param, $default = null)
    {
        try {
            $this->parse();
            $value = $this->getParams($param, null);
        } catch (\Exception $e) {
            // skip error on file read problems, just return default value
        }
        if (isset($value)) {
            return $value;
        } else {
            return $default;
        }
    }
1151566
public function getResponseParam($param) {
    if (isset($this->response[$param])) {
      return $this->response[$param];
    }
    return null;
  }
608199
public function getParameters() : array
    {
        if (is_null($this->parameters)) {
            $matches = [];
            $regExp = self::PARAMS_SEARCH_REGEXP;
            preg_match_all($regExp, $this->str, $matches);
            $this->parameters = $matches[2];
        }

        return $this->parameters;
    }
245446
protected static function paramToString($param)
    {
        if (is_string($param)) {
            return '"' . $param . '"';
        }

        if (is_numeric($param)) {
            return $param;
        }

        if (is_null($param)) {
            return 'NULL';
        }

        if (is_bool($param)) {
            return $param ? 'TRUE' : 'FALSE';
        }

        if (is_resource($param)) {
            return '#resource';
        }

        if (is_callable($param)) {
            if (is_string($param)) {
                return $param;
            }

            if (is_array($param)) {
                if (is_string($param[0])) {
                    return $param[0] . '::' . $param[1];
                } else {
                    return get_class($param[0]) . '->' . $param[1];
                }
            }

            return 'Closure';
        }

        if (is_array($param)) {
            return 'Array(' . count($param) . ')';
        }

        if (is_object($param)) {
            return get_class($param);
        }

        return 'unknown';
    }
697894
public function route( $param = null ) {
		$route = call_user_func( $this->get_route_resolver() );

		if ( is_null( $route ) || is_null( $param ) ) {
			return $route;
		}

		return array_key_exists( $param, $route[2] ) ? $route[2][ $param ] : null;
	}
828197
private function getParam($param, $default = null)
    {
        if (isset($this->query[$param])) {
            return $this->query[$param];
        } else {
            return $default;
        }
    }
600204
private function getParameterValues(array $param, FedoraResource $res): array {
        $this->getParameters();

        $values = [];
        foreach ($param as $i) {
            $ii   = explode('|', substr($i, 1, -1));
            $name = array_shift($ii);

            if ($name === 'RES_URI') {
                $value = Parameter::value($res, '', $res->getUri(true), $ii);
            } else if ($name === 'RES_ID') {
                $value = Parameter::value($res, '', $res->getId(), $ii);
            } else if (isset($this->param[$name])) {
                $value = $this->param[$name]->getValue($res, $ii);
            } else {
                throw new RuntimeException('unknown parameter ' . $name);
            }
            $values[$i] = $value;
        }

        return $values;
    }
40893
private function handleThridParameter($param) 
    {
        $result = '';
        if(is_array($param)) {
            $result = '(';
            foreach($param as $v) {
                $result .= $this->quoteValue($v) . ', ';
            }
            $result = trim($result, ', ') . ')';
        } else {
            $result = $this->quoteValue($param);
        }
        
        return $result;
    }
550687
public static function decodeParams($params)
    {
        if(!$params) {
            return [];
        }
        $paramsArrayList = json_decode(json_encode($params), true);
        $decodedParams = [];
        foreach($paramsArrayList as $paramKey=>$paramValue){
            if(is_array($paramValue)) {
                foreach($paramValue as $languageSlug=>$langParamValue){
                    if($languageSlug == App::getLocale()) {
                        $decodedParams[$paramKey] = $langParamValue;
                        break;
                    }else{
                        $decodedParams[$paramKey] = "";
                    }
                }
            }else{
                $decodedParams[$paramKey] = $paramValue;
            }
        }
        return $decodedParams;
    }
861227
protected function parseParameter()
    {
        list ($mode, $width, $height, $gravity, $background) = array_pad(
            preg_split(
                '%/%',
                $this->input['parameter'],
                -1,
                PREG_SPLIT_NO_EMPTY
            ),
            5,
            null
        );

        return $this->setParameterValues(
            (int)$mode,
            ((int)$mode !== 1 && (int)$mode !== 2) ? $this->getIntVal($width) : (int)$this->getIntVal($width),
            ((int)$mode !== 1 && (int)$mode !== 2) ? $this->getIntVal($height) : (int)$this->getIntVal($height),
            $this->getIntVal($gravity),
            $background
        );
    }
935383
def parse_parameters(self, parameters):
        """"""

        self.parameters = []
        for param_name, param_value in parameters.items():
            p = Parameter(param_name, param_value)
            if p:
                self.parameters.append(p)
1171564
public function getParam($param, $default = null) 
    {
        if(array_key_exists($param, $this->params)) {
            return $this->params[$param];
        }
        
        return $default;
    }