Generate key based on input key and parameters. Used in more sophisticated keys.

@param string $key
@param string[] $params Default [].
@return string
970915
public static function key(string $key, array $params = []): string
    {
        $key = md5(serialize($key));
        if (count($params) > 0) {
            $key .= '-' . md5(serialize($params));
        }
        return $key;
    }
938464
public static function flattenParams($params, $parentKey = null)
    {
        $result = [];

        foreach ($params as $key => $value) {
            $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key;

            if (self::isList($value)) {
                $result = array_merge($result, self::flattenParamsList($value, $calculatedKey));
            } elseif (is_array($value)) {
                $result = array_merge($result, self::flattenParams($value, $calculatedKey));
            } else {
                array_push($result, [$calculatedKey, $value]);
            }
        }

        return $result;
    }
74589
public static function param($key = ''){
		if($key){
			$get = self::get();
			$post = self::post();
			if(isset($post[$key])){
				return $post[$key] ;
			}else if(isset($get[$key])){
				return $get[$key] ;
			}else{
				return "";
			}
		}else{
			$get = self::get();
			$post = self::post();
			return array_merge($get,$post);
		}
	}
334236
public function getParam(string $key)
    {
        $isActionParam = in_array($key, [self::PARAM_CONTROLLER, self::PARAM_ACTION]);
        $params = $isActionParam ? $this->actionParams: $this->params;
        return array_key_exists($key, $params) ? $params[$key] : null;
    }
873964
private function prepareKey($key)
    {
        if (!preg_match('/^[a-zA-Z0-9_-]+$/', $key)) {
            throw new InvalidArgumentException($key);
        }

        return $this->keyPrefix . strtr($key, '-', '_');
    }
1157789
protected function getParameters(array $keys)
    {
        $parameters = [];

        foreach ($keys as $parameterKey => $default) {
            $parameters[$parameterKey] = $this->get($parameterKey, $default);
        }

        return $parameters;
    }
452985
protected function getParamsKey()
    {
        return array(
            self::PARAM_DRIVER_OPTIONS,
            self::PARAM_HOST,
            self::PARAM_DATABASE,
            self::PARAM_USER,
            self::PARAM_PASSWORD,
        );
    }
888261
public function uriReplace($key, $params)
    {
        $string = $this->uris[$key];

        $matches = null;
        $matcher = preg_match_all($this->regex, $string, $matches);

        $original = $matches[0];
        $vars     = $matches[1];

        foreach ($vars as $key => $variable) {
            if ($attribute = $params[$variable]) {
                $string = str_replace($original[$key], $attribute, $string);
            }
        }

        return $string;
    }
593490
public function translate(string $key, array $params, string $locale = null): string
    {
        $realKey = $this->getRealKey($key, $locale);
        $message = ArrayHelper::get($this->messages, $realKey);
        
        // not exist, return key
        if (!\is_string($message)) {
            return $key;
        }

        // no params
        if (!$params) {
            return $message;
        }

        return $this->formatMessage($message, $params);
    }
1214596
public function keys(?string $key = null) : array
    {
        $value = $this->get($key);

        if (!is_array($value)) {
            throw new InvalidArgumentException(
                'method keys() should be called on array'
            );
        }

        return array_keys($value);
    }
164039
public function getArray($key)
	{
		$this->validateKey($key);
		return $this->has($key) ? $this->params[$key] : [];
	}
482897
public static String get(String key, Object... params) {
		return getInstance().getLabel(key, params);
	}
1141832
function _setParams( $params, $defaults=FALSE ) {
    if( !is_array( $params))
      $params = array();
    $input = array();
    foreach( $params as $paramKey => $paramValue ) {
      if( is_array( $paramValue )) {
        foreach( $paramValue as $pkey => $pValue ) {
          if(( '"' == substr( $pValue, 0, 1 )) && ( '"' == substr( $pValue, -1 )))
            $paramValue[$pkey] = substr( $pValue, 1, ( strlen( $pValue ) - 2 ));
        }
      }
      elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 )))
        $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 ));
      if( 'VALUE' == strtoupper( $paramKey ))
        $input['VALUE']                 = strtoupper( $paramValue );
      else
        $input[strtoupper( $paramKey )] = $paramValue;
    }
    if( is_array( $defaults )) {
      foreach( $defaults as $paramKey => $paramValue ) {
        if( !isset( $input[$paramKey] ))
          $input[$paramKey] = $paramValue;
      }
    }
    return (0 < count( $input )) ? $input : null;
  }
370692
public static function &factory($key, array $params = [], $store = true) {
        if (static::has($key)) {
            return static::get($key);
        }

        $namespace = Path::toNamespace($key);
        $reflection = new ReflectionClass($namespace);
        $object = $reflection->newInstanceArgs($params);

        if ($store) {
            $object = static::set($object, $key);
        }

        return $object;
    }
127627
protected function modifyKey(string $key)
    {
        $newKey = $key;
        if (($this->getOptions() & self::KEY_LOWER) > 0) {
            $newKey = strtolower($key);
        } elseif (($this->getOptions() & self::KEY_UPPER) > 0) {
            $newKey = strtoupper($key);
        }

        return $newKey;
    }
391411
protected function get_error_message_params( $key, $params )
	{
		// do we have a label to replace the key?
		if ( isset( $this->labels[$key] ) )
		{
			$field = $this->labels[$key];
		} else {
			$field = ucfirst( str_replace( array( '_', '-' ), ' ', $key ) );
		}

		return array_merge( array( 'field' => $field ), $params );
	}
324184
public function make($key, $params = [])
    {
        if($this->aliasExist($key)) {
            return $this->make($this->aliases[$key], $params);
        }

        if(is_callable($key)) {
            return call_user_func_array($key, $this->resolveCallback($key, $params));
        }

        return $this->resolveClass($key, $params);
    }